[gdal-dev] Spatialite geometry format

Simon Lyngby Kokkendorff silyko at gmail.com
Mon May 6 06:38:59 PDT 2013


Hi List,

   I am programming an application which can transform ogr-datasources
(using our own transformation library). In that process I use ogr (version
1.10)  via the c-api to read and write datasources - usually it works like
a charm. However, when I try to write an output spatialite datasource, I
run into this error:

sqlite3_step() failed:

points2.GEOMETRY violates Geometry constraint [geom-type or SRID not
allowed] (19)


I am not sure whether it's an issue with the SRID or the geom-type /
format. I also see on the ogr-drivers page, that spatialite use a speciel
(wkb like?) format for the geometry column.


What I usually do is to clone an input feature, clone the geometry:


hGeometry = OGR_G_Clone(OGR_F_GetGeometryRef(hFeature_out));


perform some transformations and set the geometry (again):


OGR_F_SetGeometryDirectly(hFeature_out,hGeometry);


While this works for (most) input and output datasources, it produces the
error above for spatialite output. Perhaps because the internal geometry
reperesentation is wrong, or there is some other more strict check of
output srs - e.g. should I use  OGR_G_AssignSpatialReference to assign the
output spatial reference to the geometry?


Is there something obvious that I am missing here?


Best Regards,

Simon Kokkendorff,  Danish Geodata Agency
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20130506/af01e906/attachment-0001.html>


More information about the gdal-dev mailing list