Commit a429ded4 authored by Alex Kerney's avatar Alex Kerney

Handling when srid is not defined in typefmt

parent 9ee9ab32
......@@ -17,7 +17,10 @@ def geom_formatter(view, value):
"data-geometry-type": to_shape(value).geom_type,
"data-zoom": 15,
})
geojson = current_app.extensions['sqlalchemy'].db.session.scalar(func.ST_AsGeoJson(value.ST_Transform( 4326)))
if value.srid is -1:
geojson = current_app.extensions['sqlalchemy'].db.session.scalar(func.ST_AsGeoJson(value))
else:
geojson = current_app.extensions['sqlalchemy'].db.session.scalar(func.ST_AsGeoJson(value.ST_Transform( 4326)))
return Markup('<textarea %s>%s</textarea>' % (params, geojson))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment