<br><div>rashadkm@rashad-laptop:~/wt/examples/vrgeo/shp$ ogrinfo -so -al layerff.shp</div><div>ERROR 4: Unable to open layerff.shp or layerff.SHP.</div><div>Had to open data source read-only.</div><div>INFO: Open of `layerff.shp&#39;</div>

<div>      using driver `ESRI Shapefile&#39; successful.</div><div><br></div><div>Layer name: layerff</div><div>Geometry: Polygon</div><div>Feature Count: 5</div><div>Extent: (76.199480, 9.727064) - (76.863570, 10.255923)</div>

<div>Layer SRS WKT:</div><div>(unknown)</div><div>fieldname: String (1.0)</div><div>rashadkm@rashad-laptop:~/wt/examples/vrgeo/shp$ </div><div><br></div><div><br></div><div>but i had set the feild width to 132</div><div>
<br>
</div><div><div>    OGRFieldDefn oField( field, OFTString );</div><div><br></div><div>    oField.SetWidth(132);</div></div><div><br></div><div><br></div><div class="gmail_quote">On Thu, Feb 24, 2011 at 10:39 PM, Frank Warmerdam <span dir="ltr">&lt;<a href="mailto:warmerdam@pobox.com">warmerdam@pobox.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div></div><div class="h5">On 11-02-24 11:56 AM, Mohammed Rashad wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
my code<br>
field - fieldname is of string type and 0th field<br>
<br>
poFeature-&gt;SetField(&quot;fieldname&quot;,&quot;value&quot;);<br>
<br>
<br>
poFeature-&gt;GetFieldAsString(0);<br>
returns  v instead of value;<br>
<br>
I dont know is it bug or my problem<br>
<br>
but I opened the shapefile in OpenJUMP and QGIS both shows field names as only<br>
v instead of value<br>
<br>
I am working with shapefiles<br>
</blockquote>
<br></div></div>
Mohammed,<br>
<br>
What does the ogrinfo report on the field definitions look?<br>
<br>
ie.<br>
<br>
ogrinfo -so -al abc.shp<br>
<br>
I suspect the field &quot;fieldname&quot; was defined with a width of one.  SetField()<br>
will automatically truncate the value in such a case.<br>
<br>
Best regards,<br>
-- <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 Programmer for Rent<br>
<br>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">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"><br>-- <br><div>Thanks &amp;&amp; Regards</div>Rashad<br>