Opened 8 years ago
Closed 8 years ago
#6534 closed defect (fixed)
OSM driver: Problem with spatial filter and multipolygons
Reported by: | damiandixon | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Docs | Version: | 2.0.0 |
Severity: | normal | Keywords: | OSM |
Cc: |
Description
I am seeing some unexpected behavior while using a spatial filter with openstreetmap data.
I have attached 2 screenshots:
-gdalosm_withoutfilter.png: The affected area loaded via OGR, with no spatial filter set The image shows a dotted line – this is the spatial filter. The rendering has gone a bit nuts because of the missing points making a very invalid polygon. Which is why we noticed that there was a problem.
-gdalosm_withfilter.png: The affected area loaded via OGR, with a spatial filter set. The polygon is drawn as expected.
I would have expected the returned polygon to extend past the spatial filter. This behavior has not been encountered with any other data format.
My copy of GDAL has not been built against GEOS. This behavior appears to be caused by the spatial filter check in OGROSMDataSrouce::NotifyNodes
--Snip (ogrosmdatasource.cpp line 813)-- void OGROSMDataSource::NotifyNodes(unsigned int nNodes, OSMNode* pasNodes) {
unsigned int i;
const OGREnvelope* psEnvelope =
papoLayers[IDX_LYR_POINTS]->GetSpatialFilterEnvelope();
for(i = 0; i < nNodes; i++) {
/* If the point doesn't fit into the envelope of the spatial filter */ /* then skip it */ if( psEnvelope != NULL &&
!(pasNodes[i].dfLon >= psEnvelope->MinX &&
pasNodes[i].dfLon <= psEnvelope->MaxX && pasNodes[i].dfLat >= psEnvelope->MinY && pasNodes[i].dfLat <= psEnvelope->MaxY) )
continue;
Attachments (2)
Change History (3)
by , 8 years ago
Attachment: | gdalosm_withfilter.png added |
---|
comment:1 by , 8 years ago
Component: | default → Docs |
---|---|
Resolution: | → fixed |
Status: | new → closed |
gdalosm_withfilter.png