3

ArcMap creates following contents in .prj file for WGS 84.

GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]

While Geotools creates following when used ESRI citation, as per documentation: (http://docs.geotools.org/stable/userguide/library/referencing/crs.html)

GEOGCS["WGS 84", DATUM["D_WGS_1984", SPHEROID["D_WGS_1984", 6378137.0, 298.257223563, AUTHORITY["EPSG","7030"]], AUTHORITY["EPSG","6326"]], PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], UNIT["degree", 0.017453292519943295], AXIS["Geodetic latitude", NORTH], AXIS["Geodetic longitude", EAST], AUTHORITY["EPSG","4326"]]

Can anyone please tell me that why value of GEOGCS is appearing as "WGS 84" with geotools and not "GCS_WGS_1984". Because of this difference, ArcMap is not recognizing the projection.

Or is there any other way that I can create .prj file which will reflect GCS_WGS_1984?

Geotools version: 13.5

Sample code:

Formattable f = (Formattable) CRS.decode("EPSG:" + epsg.getCode(), true);    
String wkt = f.toWKT(Citations.ESRI, 0);

CoordinateReferenceSystem crs = CRS.parseWKT(wkt);
1
  • Spheroid name is wrong too.
    – mkennedy
    Mar 31, 2016 at 0:44

1 Answer 1

1

GeoTools uses the OGC standard EPSG database to determine the contents of the .prj file. The WKT format standard doesn't mandate any standard names for object in the CRS. So provided the actual parameters match, as they do in this case, the CRS are identical.

The ESRI formatter is primarily designed to put the entire WKT onto one line rather than rewrite elements in the CRS.

If you need to get an exact match I would use the ESRI code (ESRI:54001) - which from my quick scan of the esri.properties file seems to be what you need.

Otherwise you could create a new definition file and use a new FactoryUsingWKT to read it and add it into your program.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.