Skip to content
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

spain: flipped lat/lon coordinates #6222

Open
Joxit opened this issue Jan 27, 2023 · 2 comments · May be fixed by #6240
Open

spain: flipped lat/lon coordinates #6222

Joxit opened this issue Jan 27, 2023 · 2 comments · May be fixed by #6240

Comments

@Joxit
Copy link
Contributor

Joxit commented Jan 27, 2023

I was validating my data and saw a big difference in Spain, 14M of addresses was no longer located in Spain.

So I imported all data from Spain into QGIS and here is the result:
image

In purple the polygon of Spain flipped thanks to ST_FlipCoordinates.

As you can see, affected data are: es/25829, es/25830, es/25831 and es/32628. You can easily do the check with a random line and geojson.io

@iandees
Copy link
Member

iandees commented Jan 30, 2023

I wonder if you could grab the original data and see if it's flipped as well? There was an issue when we updated our data processing software a while back where they changed the default ordering of lat/lon. I thought we had fixed this at that point.

@Joxit
Copy link
Contributor Author

Joxit commented Jan 30, 2023

Hi,
I tried https://data.openaddresses.io/cache/es-25829.zip from es/25829.json. The first element is

lon,lat,number,street,postcode,admin
718686.87,4280777.71,1,CL ALMENDRALEJO,6207,

So let's try to convert EPSG:25829 into WSG84 and then GeoJSON with Postgis ('cause I like it).

SELECT ST_AsGeoJSON(ST_Transform(ST_SetSRID(ST_MakePoint(718686.87, 4280777.71), 25829), 4326));

And the result is located in Spain:

 {"type":"Point","coordinates":[-6.48706945435077,38.6485910284446]}

image

Just to check with another do tool, epsg.io gives me the same result.

So your data in cache seems to be correct 👍.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants