-
-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
switch to epsg.org as data source? #12
Comments
Upon further digging around I found out that epsg.io does in fact contain the correct transformation, it is just not the selected default transformation... If you go to https://epsg.io/2169 you will see the transformation variants listed on the top left, the second one seems to give the correct results with proj4js. I don't know how this data can be accessed in a machine-readable way, or on which basis the transformation should be chosen to ensure compatibility with Proj4JS ... I will update the issue title and description accordingly. |
related: maptiler/epsg.io#171 |
What do you think we shall do?
|
I tried to get to the bottom of this issue, but I still don't fully understand what's going on here and what the solution would be. epsg.io does contain the transformation data needed for Proj4JS, but unfortunately listed among other transformations which don't work with Proj4JS. I have not found a way to get any kind of metadata that would allow to choose the suitable transformation in an automated way. I am also kind of sure that the Long story short, regarding the three options you gave, here's what I can comment:
Unfortunately the whole issue left me kind of puzzled, and I ran out of time to investigate further for now. In my own application ( https://cartolab.at/coords/ ) I resorted to manually fixing incorrect transformations whenever a problem is pointed out by my users, but this is not a feasible approach for epsg-index, I guess. So unfortunately I don't have a concrete suggestion at this time for how to proceed ☹. |
Hello, everybody! Chiming in with a related issue: now epsg.io uses So I had to switch to epsg.org database for my project. You can get the database by registering an account on epsg.org. My code passes my limited tests, and there seems to be little to no difference between coordinates produced my Proj4 strings and Proj4 strings from epsg.io before it was updated. Since epsg.io is not an official data source, I've decided to keep whatever is in epsg.org database. Still, I'm not sure if I did everything right, can never be :) If you're interested in my approach, take a look at this file. It builds Proj4 strings for CRS and depends on other scripts in the same directory. As for |
The collection of parameters harvested from epsg.io results in parameters that give incorrect results when used in conjunction with proj4JS. The CRS data published at spatialreference.org seems to be more reliable in this regard.
For now it is only anecdotal evidence, but I have identified two cases where this causes incorrect results when using epsg-index:
EPSG:2169
https://epsg.io/2169 gives as a proj4 definition:
+proj=tmerc +lat_0=49.8333333333333 +lon_0=6.16666666666667 +k=1 +x_0=80000 +y_0=100000 +ellps=intl +towgs84=-265.8867,76.9851,20.2667,0.33746,3.09264,-2.53861,0.4598 +units=m +no_defs +type=crs
https://spatialreference.org/ref/epsg/2169/ gives:
+proj=tmerc +lat_0=49.83333333333334 +lon_0=6.166666666666667 +k=1 +x_0=80000 +y_0=100000 +ellps=intl +towgs84=-193,13.7,-39.3,-0.41,-2.933,2.688,0.43 +units=m +no_defs
(note the diverging towgs84 parameter!)
The latter one seems to be correct, see this thread on Mastodon for the feedback of someone with local knowledge: https://mapstodon.space/@jaykayone/111325366362650226
Simplified test case here: https://observablehq.com/d/841eca8097085b5d , with the definition from spatialreference.org giving the correct result.
EPSG:4312
https://epsg.io/4312 :
+proj=longlat +ellps=bessel +no_defs +type=crs
https://spatialreference.org/ref/epsg/4312/ :
+proj=longlat +ellps=bessel +towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232 +no_defs
Again, the latter one is correct, as the first one is missing the crucial towgs84 parameter.
I have no idea what is going on here, or how to reach the maintainers of epsg.io, but these (admittedly anecdotal) data points strongly suggest that epsg.io cannot be trusted as a source for CRS info.
Switching to the data from spatialreference.org should be easy, as the URL pattern https://spatialreference.org/ref/epsg/{epsg_code}/proj4/ will get a text-only response with the proj4 definition.
The text was updated successfully, but these errors were encountered: