문제

I have some coordinate data and the only thing i know about its coordinate system is the following description:

PROJCS["Basic Albers NAD83",
    GEOGCS["GCS_North_American_1983",
           DATUM["D_North_American_1983",
           SPHEROID["GRS_1980",6378137.0,298.257222101]
    ],
    PRIMEM["Greenwich",0.0],
    UNIT["Degree",0.0174532925199433]         
       ],
 PROJECTION["Albers"],
       PARAMETER["False_Easting",0.0],
 PARAMETER["False_Northing",0.0],
       PARAMETER["Central_Meridian",-96.0],
       PARAMETER["Standard_Parallel_1",45.5],
       PARAMETER["Standard_Parallel_2",29.5],
       PARAMETER["Latitude_Of_Origin",23.0],
       UNIT["Foot_US",0.3048006096012192]
     ]

this comes from a prj arcGis file.

I need to convert from this system to GPS (Google maps) system and vice-versa.

this must be done programatically and i cannot use esri libraries (license issues)...

Could you explain the meaning of all these parameters?

are the coordinates expressed in the spheroid and the projection (albers) used only when drawing the map? or the coordinates depend on the projection used also?

Do you know an open source library I could use for this transformation?

Thanks!

도움이 되었습니까?

해결책

All these parameters define the projection, including:

  • Projection type (Albers)
  • GEOGCS defines the geoid (idealized Earth shape) used by the project. In this case, it's NAD83, which uses degrees for units and is centered at the Greenwich, the 0th longitude.
  • Where the projection itself is centered
  • How far the projection is moved north and east to make any negative coordinates positive (False Easting and False Northing)
  • Units for coordinates in this projection (US Feet)
  • Some other information about how coordinates of the projection were transformed to be drawn on a flat service.

I have a blog post which goes over the details for an OGC WKT definition, which is very similar to the content in an ESRI .prj file: http://www.dev-garden.org/2011/07/30/projections-for-programmers-one-projection/. You may find it useful.

With projected coordinates, they have already been 'drawn on the map', and you need to reproject them to use in other coordinate systems like Google's projection.

There are many open source tools you can use to reproject your coordinates from one projected system to another. Here are a few:

  • Geotools or Proj4j - Java
  • Proj4js - Javascript
  • Proj - C or C++
  • dotspatial - C#

One command line tool I find very useful is ogr2ogr. Using ogr2ogr, it is very easy to reproject coordinates from one system to another. Here's how to convert a projected shapefile to a Google Earth projection:

ogr2ogr -f "ESRI Shapefile" -t_srs EPSG:3857 NEWFILE.shp OLDFILE.shp

Ogr2ogr uses the .prj file to determine the current projection of the shapefile, and then reprojects it to Googles projection, defined here by the EPSG shorthand EPSG:3857. You can find ogr2ogr for Windows and other platforms at http://fwtools.maptools.org/

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top