OSGeo / PROJ

PROJ - Cartographic Projections and Coordinate Transformations Library
https://proj.org
Other
1.67k stars 761 forks source link

epsg file definitions differ from those on spatialreference.org #230

Closed proj4-bot closed 9 years ago

proj4-bot commented 9 years ago

Reported by urmenyi on 7 Feb 2014 10:27 UTC Hi,

I've had two cases recently where the PROJ definition in the proj4 epsg file for an EPSG code differs from that online at spatialreference.org

In both cases the online version was the one I needed.

I use proj to convert highway survey network maps from "local" coordinates to a relevent UTM zone via WGS84, and I check the results of the conversion by overlaying onto a UTM bing map projection via Mapnik in our app. In both cases the epgs file spec produced output shifted by 100m or so, while the spatialreference.org was spot on as far as I can see.

The two EPSGs that gave me trouble were:

Austria: http://spatialreference.org/ref/epsg/31256/proj4/

Holland: http://spatialreference.org/ref/epsg/28992/proj4/

My plan is to replace the proj4 epsg file with all the proj4 strings from spatialreference.org. I can't find a single downloadable file or dbase with these in so I will write a web crawler to fetch them all via http. I will attach a new epsg file here once I'm done, probably in the next 2 months.

Regards, Howard

Migrated-From: https://trac.osgeo.org/proj/ticket/230

proj4-bot commented 9 years ago

Comment by 45136 on 1 May 2014 09:51 UTC Can you explain what differences you encountered?

The first one has the same towgs84 parameters as in latest GDAL builds, while the second misses any towgs84 parameters.

Parameters for MGI are different in Austria and former Yougoslavia, and were wrong for a long time.

Note that spatialreference.org is not actively maintained. The data there is from 2007 and 2005. PROJ always tries to reflect the latest data from the EPSG database.

proj4-bot commented 9 years ago

Comment by HUrmenyi on 1 May 2014 10:17 UTC Thanks for taking a look at this Frank. OK I didn't realize what was newer, proj4 or the spatialref site. In both the cases given in this ticket, we had files from customers that I could only convert correctly by using the older EPSG definition from the spatial ref site, so their mistake I guess. I suppose the real solution is for me to abandon EPSG codes and have them enter the system refs as they appear in their GIS, (I think the Austrian customer was using ARC View)

Anyhow, here's the full info:

I am using Proj v4.8.0 (Proj4 change log: 2012-03-06 Frank Warmerdam warmerdam@pobox.com)

MGI / Austria GK East

PROJ4 epsg file:

MGI / Austria GK East

<31256> +proj=tmerc +lat_0=0 +lon_0=16.33333333333333 +k=1 +x_0=0 +y_0=-5000000 +datum=hermannskogel +units=m +no_defs <> Spatialreference.org: http://spatialreference.org/ref/epsg/31256/proj4/ +proj=tmerc +lat_0=0 +lon_0=16.33333333333333 +k=1 +x_0=0 +y_0=-5000000 +ellps=bessel +towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232 +units=m +no_defs Amersfoort / RD New PROJ4 epsg file: # Amersfoort / RD New <28992> +proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +towgs84=565.417,50.3319,465.552,-0.398957,0.343988,-1.8774,4.0725 +units=m +no_defs <> Spatialreference.org: http://spatialreference.org/ref/epsg/28992/proj4/ +proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +units=m +no_defs
proj4-bot commented 9 years ago

Comment by HUrmenyi on 1 May 2014 10:39 UTC By the way, is there an easy way I can query the EPSG database directly myself?

proj4-bot commented 9 years ago

Comment by 45136 on 1 May 2014 16:57 UTC The

datum=hermannskogel

is defined in PROJ4 as

+towgs84=653.0,-212.0,449.0

but is not used for EPSG:31256 anymore. That reads now:

+proj=tmerc +lat_0=0 +lon_0=16.33333333333333 +k=1 +x_0=0 +y_0=-5000000 +ellps=bessel +towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232 +units=m +no_defs

(same as spatialreference.org)

You can query the EPSG database at http://www.epsg-registry.org/ or download it from http://info.ogp.org.uk/geodesy/CurrentDB.html in various formats.