<div dir="ltr">Hi List,<div><br></div><div style>   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:</div>
<div style><br></div><div style><p style="margin:0px"><span style="color:rgb(0,0,0)">sqlite3_step() failed:</span></p>
<p style="margin:0px"><span style="color:rgb(0,0,0)">  points2.GEOMETRY violates Geometry constraint [geom-type or SRID not allowed] (19)</span></p><p style="margin:0px"><span style="color:rgb(0,0,0)"><br></span></p><p style="margin:0px">
<span style="color:rgb(0,0,0)">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.</span></p>
<p style="margin:0px"><span style="color:rgb(0,0,0)"><br></span></p><p style="margin:0px"><span style="color:rgb(0,0,0)">What I usually do is to clone an input feature, clone the geometry:</span></p><p style="margin:0px">
<span style="color:rgb(0,0,0)"><br></span></p><p style="margin:0px"><font color="#000000">hGeometry = OGR_G_Clone(OGR_F_GetGeometryRef(hFeature_out));</font><br></p><p style="margin:0px"><font color="#000000"><br></font></p>
<p style="margin:0px"><font color="#000000">perform some transformations and set the geometry (again): </font></p><p style="margin:0px"><font color="#000000"><br></font></p><p style="margin:0px"><font color="#000000">OGR_F_SetGeometryDirectly(hFeature_out,hGeometry);<br>
</font></p><p style="margin:0px"><font color="#000000"><br></font></p><p style="margin:0px"><font color="#000000">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 </font><span style="background-color:rgb(226,232,242);color:rgb(37,53,85);font-family:'Lucida Grande',Verdana,Geneva,Arial,sans-serif;font-size:12px;font-weight:bold;white-space:nowrap"> </span>OGR_G_AssignSpatialReference to assign the output spatial reference to the geometry?</p>
<p style="margin:0px"><font color="#000000"><br></font></p><p style="margin:0px"><font color="#000000">Is there something obvious that I am missing here?  </font></p><p style="margin:0px"><font color="#000000"><br></font></p>
<p style="margin:0px"><font color="#000000">Best Regards,</font></p><p style="margin:0px"><font color="#000000">Simon Kokkendorff,  Danish Geodata Agency</font></p></div></div>