Skip to main content
Solved

Native spatial query using SQLExecutor on OSM ways in database tables

  • November 12, 2018
  • 2 replies
  • 32 views

btl
Contributor
Forum|alt.badge.img+8

With reference to the following tutorial which uses the SQLExecutor to perform a spatial query in SQL - https://knowledge.safe.com/articles/19649/performing-native-spatial-queries-on-database-tabl.html

This works for nodes in my OSM postGIS table but if I try exactly the same method on ways it throws an error. e.g.:

select *, "id", "tags"->'highway' as "highway" from ways as osm
where "tags"->'highway' is not Null and ST_Within(osm.geom, ST_GeomFromText('@Value(_geometry)', 4326))=TRUE

The log says a fatal error occurs at the character which I've underlined in the code above (osm.geom).

How can I use this method to query for ways?

Best answer by ebygomm

Is your geometry column called geom?

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

ebygomm
Influencer
Forum|alt.badge.img+46
  • Influencer
  • Best Answer
  • November 12, 2018

Is your geometry column called geom?


btl
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • November 12, 2018

Is your geometry column called geom?

It seems that for ways it's called linestring - thank you, this works now.