optimisation calcul hash/validité geojson
This commit is contained in:
parent
268c270ac0
commit
071005528f
1 changed files with 4 additions and 4 deletions
|
@ -122,9 +122,9 @@ class EventResource(BaseEvent):
|
||||||
# get its id (md5 hash)
|
# get its id (md5 hash)
|
||||||
h = cur.fetchone()
|
h = cur.fetchone()
|
||||||
if h is None:
|
if h is None:
|
||||||
cur.execute("""SELECT md5(st_asewkt(st_geomfromgeojson( %s ))),
|
cur.execute("""SELECT md5(st_asewkt(geom)),
|
||||||
ST_IsValid(st_geomfromgeojson( %s )),
|
ST_IsValid(geom),
|
||||||
ST_IsValidReason(st_geomfromgeojson( %s )) ;""", (geometry,geometry,geometry))
|
ST_IsValidReason(geom) from (SELECT st_geomfromgeojson( %s ) as geom) as g ;""", (geometry,))
|
||||||
h = cur.fetchone()
|
h = cur.fetchone()
|
||||||
return h
|
return h
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue