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?