I have seen that OGR supports it's own form of SQL, I was wondering if it's possible to do spatial joins.
Something like select all objects where one intersects the other. I did have a look around but couldn't really see anything.
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.Sign up to join this community
The OGR SQL is only for standard attribute queries, and not for spatial queries.
The only geometry related queries that can be run are to query by area using the keyword OGR_GEOM_AREA
SELECT * FROM nation WHERE OGR_GEOM_AREA > 10000000'
If you run the OGR SQL against a datasource that is a database then the SQL query is executed using the database's own SQL implementation.
To do queries such as intersections with OGR you'd need to use the OGRGeometryClass. Personally I find it easier to use the opensource Shapely library for these types of query, or use the spatial queries in the underlying geodatabase (SQL Server, Oracle, PostGIS etc.)