ThinkGeo.com    |     Documentation    |     Premium Support

Proj4 from Prj extension drops datum

Hi,

I am using the Proj4Projection.ConvertPrjToProj4() extension to generate the Proj4 string from prj files. I’ve noticed though that the format of the prj string isn’t always handled particularly for the datum definition.

For example, if the prj contains

DATUM[“D_WGS_1984”

then the proj4 correctly has +datum=WGS84

But, if the prj has the following for DATUM, the proj4 string will drop the datum definition altogether.

DATUM[“D_WGS84”

I am getting a lot of shapefiles from clients with this issue, so I am wondering where D_WGS84 as the datum originates? Seems like it may be an older OGC standard instead of ESRI. Will mapsuite deal with both?

Can you suggest any logic to infer the proper proj4 string? What about other datums?

Thanks,
Damian

Hi Damian,

Just like you found, the OGC wkt is not the same as Esri wkt, the API ConvertPrjToProj4 is convert Esri Wkt to Proj4 string. It cannot parse OGC wkt well, for example, for DATUM[“D_WGS_1984” it convert it as +datum=WGS84 but for DATUM[“D_WGS84” it convert it as +ellps=WGS84.

If you make sure your client’s wkt is OGC wkt, you should want to convert them before use it, here is some discuss about it: https://gis.stackexchange.com/questions/129764/how-are-esri-wkt-projections-different-from-ogc-wkt-projections

We don’t have related API for it, but I will let our developer team know this problem, maybe it will get supported in future.

Regards,

Ethan

Thanks Ethan. Let me know if you extend the functionality.

Regards,
Damian

Hi Damian,

Any question please let us know.

Regards,

Ethan