Skip to main content
Solved

Native spatial query using SQLExecutor on OSM ways in database tables


btl
Contributor
Forum|alt.badge.img+3
  • Contributor

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?

View original
Did this help you find an answer to your question?

2 replies

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

Is your geometry column called geom?


btl
Contributor
Forum|alt.badge.img+3
  • Author
  • Contributor
  • November 12, 2018
ebygomm wrote:

Is your geometry column called geom?

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings