[gdal-dev] Re: Slow writing into Spatialite with -skipfailures
Jukka Rahkonen
jukka.rahkonen at mmmtike.fi
Tue Apr 10 09:51:42 EDT 2012
Even Rouault <even.rouault <at> mines-paris.org> writes:
> Hum, would be interesting to have a sample to examine one of the
geometry that
> triggers the error. The SRID hypothesis seems unlikely, and as far
as the
> geometry type is concerned, it is weird because you have specified -nlt
> MULTIPOLYGON ...
>
> I imagine once the reason for the error(s) is more clearly identified,
the
> possibility for a prefiltering in ogr2ogr could be studied to avoid
trying to
> insert such features, and thus benefiting for transactions.
I managed to trap one problematic case but there is something weird
going on. The feature comes originally from Oracle and it is for sure
a polygon there (GTYPE=2003). I have converted it into shapefile with
GDAL 1.6 and OCI plugin from OSGeo4W because for some reason I have
not managed to connect our Oracle with more recent versions.
Now GDAL 1.6 that I used for converting polygon from Oracle into
shapefile tells that geometry is a polygon, while GDAL 1.9 claims
that it is a multipolygon.
Ogr2ogr of GDAL 1.9 with this shapefile created by GDAL 1.6 leads
to an error:
ogr2ogr -f SQLite -dsco spatialite=yes -dsco init_with_epsg=yes
-a_srs epsg:2393 multi.sqlite multi.shp
ERROR 1: sqlite3_step() failed:
multi.GEOMETRY violates Geometry constraint
[geom-type or SRID not allowed] (19)
ERROR 1: ROLLBACK transaction failed: cannot rollback - no
transaction is active
ERROR 1: Terminating translation prematurely after failed
translation of layer multi (use -skipfailures to skip errors)
The error is the same even if I use -nlt multipolygon.
If I convert the GDAL 1.6 shapefile into a new shapefile with GDAL 1.9 the
geometry is reported to be of type POLYGON and conversion into spatialite is
successful. I cannot say if the problem is in GDAL 1.6 or in the Oracle OCI
driver or what but anyway I believe that the shapefile is somehow corrupted or
at least GDAL 1.9 thinks so.
The one-feature shapefile (multi?)polygon shapefile created by
GDAL 1.6+OCI is here
http://latuviitta.org/documents/multi.zip
-Jukka Rahkonen-
More information about the gdal-dev
mailing list