pas de SRID dans le calcul de hash

This commit is contained in:
cquest 2016-11-20 18:57:03 +01:00
parent 604a079368
commit 367eb73dd4

View file

@ -113,7 +113,7 @@ class EventResource(BaseEvent):
def maybe_insert_geometry(self, geometry, cur):
# insert into geo table if not existing
cur.execute("""INSERT INTO geo
SELECT geom, md5(st_asewkt(geom)) as hash, st_centroid(geom) as geom_center FROM
SELECT geom, md5(st_astext(geom)) as hash, st_centroid(geom) as geom_center FROM
(SELECT st_setsrid(st_geomfromgeojson( %s ),4326) as geom) as g
WHERE ST_IsValid(geom)
ON CONFLICT DO NOTHING RETURNING hash;""",