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

SRID issues #5

Open
benizar opened this issue May 29, 2018 · 3 comments
Open

SRID issues #5

benizar opened this issue May 29, 2018 · 3 comments
Assignees

Comments

@benizar
Copy link
Contributor

benizar commented May 29, 2018

There are several issues related to the different SRIDs we are using. I have checked that:

  • the st_fromgeohash(geom) function returns geometries without specifying a SRID
  • the SIOSE dump is in 4258.
SELECT find_srid('public','gh','geom'); -- 0
SELECT find_srid('public','roi','geom'); -- 4326
SELECT find_srid('s2005','t_poli_geo_castellon','geom'); --4258

Because geohashes are meant to be used in 4326, we need to fix this on the pg_geohash_extra extension.

After that, we have to decide whether we choose one of these three options:

  1. Transform backups to 4326
  2. Transform the database at the entry-point
  3. Use a query to solve that on demand (see the following).
SELECT * 
FROM s2005.t_poli_geo_castellon AS pol
WHERE st_intersects(st_transform(st_setsrid(pol.geom,4258),4326),
					st_setsrid(st_geomfromgeohash('ezp6r'),4326));
@benizar benizar self-assigned this May 29, 2018
@benizar
Copy link
Contributor Author

benizar commented May 29, 2018

I'm going to take care of fixing the pg_geohash_extra part.

@quommit what do you think about the other options?

@benizar
Copy link
Contributor Author

benizar commented Jun 1, 2018

This commit on pg_geohash_extra ensures that geohashes are in the correct SRID.

It remains the question about transforming the SIOSE geodatabase to 4326 or even to geography data type.

@benizar
Copy link
Contributor Author

benizar commented Jun 4, 2018

@quommit
Could you modify the backups:

  1. Transform backups to SRID=4326? Or maybe you have already a command to do that? Right now, I think we could keep both of them (4258 and 4326), but the 4326 version will save time and code when working with geohashes...
  2. Remove modifiers from siose table names. e.g. t_poli_geo_castellon should be t_poli_geo.

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

No branches or pull requests

2 participants