[GRASS-SVN] r73577 - grass/trunk/vector/v.in.ogr
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Oct 20 01:19:14 PDT 2018
Author: mmetz
Date: 2018-10-20 01:19:14 -0700 (Sat, 20 Oct 2018)
New Revision: 73577
Modified:
grass/trunk/vector/v.in.ogr/main.c
Log:
v.in.ogr: disable unreliable OGR extents for spatial filter
Modified: grass/trunk/vector/v.in.ogr/main.c
===================================================================
--- grass/trunk/vector/v.in.ogr/main.c 2018-10-19 11:34:22 UTC (rev 73576)
+++ grass/trunk/vector/v.in.ogr/main.c 2018-10-20 08:19:14 UTC (rev 73577)
@@ -2179,6 +2179,8 @@
/* use OGR extents if possible, needed to skip corrupted data
* in OGR dsn/layer */
+ /* BUT: OGR extents are unreliable,
+ * sometimes excluding valid features */
have_ogr_extent[layer] = 1;
}
/* OGR_L_GetExtent():
@@ -2236,7 +2238,10 @@
for (layer = 0; layer < nlayers; layer++) {
int have_filter = 0;
- if (have_ogr_extent[layer]) {
+ /* OGR extents are unreliable,
+ * sometimes excluding valid features:
+ * disabled */
+ if (0 && have_ogr_extent[layer]) {
if (*xmin <= *xmax && *ymin <= *ymax) {
/* check for any overlap */
if (xminl[layer] > *xmax || xmaxl[layer] < *xmin ||
@@ -2257,9 +2262,7 @@
ymaxl[layer] = MIN(ymaxl[layer], *ymax);
}
}
- /* disable spatial filter based on extents as reported by OGR
- * because these extents can be wrong */
- /* have_filter = 1; */
+ have_filter = 1;
}
else if (*xmin <= *xmax && *ymin <= *ymax) {
xminl[layer] = *xmin;
More information about the grass-commit
mailing list