<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jun 6, 2013 at 3:34 PM, Mauro Pisano <span dir="ltr"><<a href="mailto:mauropisano@suremptec.com.ar" target="_blank">mauropisano@suremptec.com.ar</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br clear="all"><div><div dir="ltr"><div>Hi everyone!<br></div><div><br>I have a question about using the method OGRLayer::Layer().<br>
<br>Following i show you a protion of code:</div><div><br></div>
<div><div>/*** */</div><div>// Create geometry from wkt</div><div>OGRGeometryFactory::createFromWkt(&pwkt, pSpatialRef, &pgeometry);</div><div><br></div><div>/** Configure geom</div><div>pCurrentFeature_->SetGeometry(&pgeometry);</div>
</div></div></div></div></blockquote><div><br></div><div style>Mauro,</div><div style><br></div><div style>Assuming  that pgometry is declared as "OGRGeometry *pgeometry;" I don't see how the proposed SetGeometry call would compile.  You should be passing an OGRGeometry* to SetGeometry, not an OGRGeometry**.  Also, if you aren't going to use the geometry for anything else you might as well call SetGeometryDirectly() which grants ownership of the geometry to the feature so you don't have to free it.</div>
<div style><br></div><div style><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div dir="ltr"><div>
<div><br></div><div>if (pCurrentLayer_->SetFeature(pCurrentFeature_) != OGRERR_NONE) {</div><div>    SHOW_ERROR(message_LAYER_MODIFIED_CLOSE_ERROR);</div><div>}</div></div></div></div></div></blockquote><div><br></div>
<div style>Note that SetFeature() is used to update an existing featre in the layer.  I think you creating new features and so you should be using CreateFeature().  With SetFeature() you are supposed to have the FID already established so the layer knows where it belongs. </div>
<div style><br></div><div style>I'm not sure why you are seeing an error put still that things seem to work.  </div><div style><br></div><div style>Best regards,</div><div style>Frank</div><div style> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div><div dir="ltr"><div><br></div><div>1: The SetFeature, returns with an error, but if I open the .DBF file I found that the insert was made.</div>
<div>Then... why I have the Feature set?, taking account that the method is returning FAIL.</div><div><br></div><div>2: Suppose that i have two features, and I open it and started to edit a third feature. Whats</div>
<div> wrong in this case,  is that after the insert, the value of the FID is a very very very big number. Example:<br><br>Feature 1 = FID = 0;<br>Feature 2 = FID = 1;<br>Feature 3 = FID = 2893772.<br><br>I dont  have any clue about whats happening, any kind of data will be appreciated.</div>

<div><br></div><div>Thanks in advance, </div><div><br></div><div>Mauro Pisano<br></div><div>SUR Emprendimientos Tecnológicos</div><div><br></div><div>Perú 345  Piso 5to Oficina "B" (C1067AAG)</div><div>
Ciudad de Buenos Aires, Argentina</div><div>Tel. +54 <a href="tel:%2811%29%204342-2976%2F84" value="+14342297684" target="_blank">(11) 4342-2976/84</a></div><div><a href="mailto:mauropisano@suremptec.com.ar" style="color:rgb(17,85,204)" target="_blank">mauropisano@suremptec.com.ar</a></div>
<div><a href="http://www.suremptec.com/" style="color:rgb(17,85,204)" target="_blank">www.suremptec.com</a></div>
</div></div>
</div>
<br>_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br>---------------------------------------+--------------------------------------<br>
I set the clouds in motion - turn up   | Frank Warmerdam, <a href="mailto:warmerdam@pobox.com" target="_blank">warmerdam@pobox.com</a><br>light and sound - activate the windows | <a href="http://pobox.com/~warmerdam" target="_blank">http://pobox.com/~warmerdam</a><br>
and watch the world go round - Rush    | Geospatial Software Developer<br>
</div></div>