<div dir="ltr">Hi guys!<div><br></div><div>Im having a problem by using the OGRLayter::CreateField method, it isnt creating the field as the description saids :).<br><br>Maybe you can see the error or have an idea to go out of this hole.<br>
<br>Here are the lines of code:<br><br><div><b><font face="verdana, sans-serif">...</font></b></div><div><b><font face="verdana, sans-serif">...</font></b></div><div><b><font face="verdana, sans-serif"> OGRLayer* player = pvector->GetLayer(0);</font></b></div>
<div><font face="verdana, sans-serif"><br></font></div><div><b><font face="verdana, sans-serif"> if (player->GetLayerDefn()->GetFieldIndex(SUR_HOTLINK_FIELD) < 0) {</font></b></div><div><font face="verdana, sans-serif"> // If the field doesnt exist, I create it.</font></div>
<div><b><font face="verdana, sans-serif"> OGRFieldDefn field(SUR_HOTLINK_FIELD, OFTString);</font></b></div><div><font face="verdana, sans-serif"> // Try to insert it to the table.</font></div><div><b><font face="verdana, sans-serif"> if ( player->CreateField(&field, TRUE) == OGRERR_NONE )</font></b></div>
<div><b><font face="verdana, sans-serif"> SHOW_ERROR("D:Error trying to create field);</font></b></div><div><b><font face="verdana, sans-serif"> }</font></b></div></div><div><b><font face="verdana, sans-serif">...</font></b></div>
<div><b><font face="verdana, sans-serif">...</font></b></div><div><br></div><div><b>NOTES:</b></div><div>the first line returns me without problems the Working Layer ( I just using just 1 layer to avoid confusions )</div>
<div>the first IF returns that there arent any <font face="verdana, sans-serif">SUR_HOTLINK_FIELD in the table ( that its OK! )</font></div><div><font face="verdana, sans-serif"><br></font></div><div><font face="verdana, sans-serif">and de last IF returns that the CreateField gives distinct as OGRERR_NONE.</font></div>
<div><font face="verdana, sans-serif"><br></font></div><div><br></div><div>Thanks in advance!<br></div><div><div><div dir="ltr"><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 (11) 4342-2976/84</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></div>