Drawing spatial filters

May 20, 2026 ยท View on GitHub

When options.drawing is true the map gains rectangle and polygon drawing tools (from leaflet-draw). When you finish a shape, a panel appears in the bottom-left of the map with a ready-to-paste GeoSPARQL filter:

FILTER(geof:sfWithin(?geom, "POLYGON((4.30 50.80, 4.40 50.80, 4.40 50.90, 4.30 50.80))"^^geo:wktLiteral))

A Copy button copies the snippet to the clipboard. Drop it into the YASQE editor to constrain your next query to the area you just drew.

Required prefixes

Add these to your query:

PREFIX geo: <http://www.opengis.net/ont/geosparql#>
PREFIX geof: <http://www.opengis.net/def/function/geosparql/>