geometry output NULL

28 views
Skip to first unread message

Tara

unread,
Nov 18, 2017, 11:10:47 AM11/18/17
to SpatiaLite Users
Hello,

I am trying following query:

SELECT AsGeoJSON(ST_GeomFromText(a.geometry)) as geometry, a.name, a.node_id
        FROM my_points
        AS a
        WHERE Contains(Buffer(GeomFromText('POINT(1007069.1726977603 6194484.57197054)', 3857), 90), a.geometry);

However the output of my geometry column in NULL instead of getting an GeoJson geometry type. Does anyone now what do I have to do?

mj10777

unread,
Nov 18, 2017, 11:17:17 AM11/18/17
to SpatiaLite Users
The geometry column is null because because it is not a geometry (a.geometry is a geometry)
ST_GeomFromText(a.geometry) : is a Text representation of a.geometry
AsGeoJSON(ST_GeomFromText(a.geometry)) causes an error (your NULL)

Does anyone now what do I have to do?
- AsGeoJSON(a.geometry) will give the GeoJSON-Text representation of a.geometry

Hope this helps,

Mark

Tara

unread,
Nov 18, 2017, 11:28:16 AM11/18/17
to SpatiaLite Users
cool thanks it worked!
Reply all
Reply to author
Forward
0 new messages