GDAL 1.7.2<br><br>ogrinfo my.gml Borehole<br>Had to open data source read-only.<br>INFO: Open of `my.gml'<br> using driver `GML' successful.<br><br>Layer name: Borehole<br>Geometry: Unknown (any)<br>Feature Count: 1<br>
Extent: (-28.413900, 121.142000) - (-28.413900, 121.142000)<br>Layer SRS WKT:<br>(unknown)<br>name: String (71.0)<br>sampledFeature: String (0.0)<br>OGRFeature(Borehole):0<br> name (String) = WTB5<br> sampledFeature (String) = <br>
POINT (-28.413900000000002 121.141999999999996)<br><br><br>GDAL 1.8.1<br>java -Djava.library.path=. -cp gdal.jar:build/apps ogrinfo /home/nickhatz/my.gml Borehole<br><br>INFO: Open of `/home/nickhatz/my.gml'<br> using driver `GML' successful.<br>
<br>Layer name: Borehole<br>Geometry: Point<br>Feature Count: 1<br>Extent: (121.142, -28.4139) - (121.142, -28.4139)<br>Layer SRS WKT:<br>GEOGCS["WGS 84",<br> DATUM["WGS_1984",<br> SPHEROID["WGS 84",6378137,298.257223563,<br>
AUTHORITY["EPSG","7030"]],<br> AUTHORITY["EPSG","6326"]],<br> PRIMEM["Greenwich",0,<br> AUTHORITY["EPSG","8901"]],<br> UNIT["degree",0.0174532925199433,<br>
AUTHORITY["EPSG","9122"]],<br> AUTHORITY["EPSG","4326"],<br> AXIS["Latitude",NORTH],<br> AXIS["Longitude",EAST]]<br>gml_id: String (0.0)<br>name: StringList (0.0)<br>
sampledFeature: String (0.0)<br>elevation: Real (0.0)<br>driller: String (0.0)<br>dateOfDrilling: String (10.0)<br>drillingMethod: String (12.0)<br>startPoint: String (22.0)<br>inclinationType: String (8.0)<br>lowerCorner: Real (0.0)<br>
upperCorner: Real (0.0)<br>coreCustodian: String (0.0)<br>OGRFeature(Borehole):5<br> gml_id (String) = gsml.borehole.WTB5<br> name (StringList) = (2:,...)<br> sampledFeature (String) = <br> elevation (Real) = 45<br> driller (String) = <br>
dateOfDrilling (String) = 2004-09-17<br> drillingMethod (String) = diamond core<br> startPoint (String) = natural ground surface<br> inclinationType (String) = vertical<br> lowerCorner (Real) = 106<br> upperCorner (Real) = 249<br>
coreCustodian (String) = <br> POINT (121.142 -28.4139)<br><br><br>What version are you running?<br><br>--Nikos<br><br><br><br><div class="gmail_quote">On Mon, Aug 8, 2011 at 6:45 PM, Frank Warmerdam <span dir="ltr"><<a href="mailto:warmerdam@pobox.com" target="_blank">warmerdam@pobox.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div>On Mon, Aug 8, 2011 at 6:39 PM, Nikolaos Hatzopoulos <<a href="mailto:nhatzop@gmail.com" target="_blank">nhatzop@gmail.com</a>> wrote:<br>
> System.out.println("Elevation"+poDS.GetLayerByIndex(0).GetFeature(0).GetFieldAsString("elevation"));<br>
><br>
> ERROR 1: No such a field 'elevation'<br>
<br>
<br>
</div>Niko,<br>
<br>
Odd, for me ogrinfo reports:<br>
<br>
...<br>
gml_id: String (0.0)<br>
name: StringList (0.0)<br>
sampledFeature: String (0.0)<br>
elevation: Real (0.0)<br>
driller: String (0.0)<br>
dateOfDrilling: String (10.0)<br>
drillingMethod: String (12.0)<br>
startPoint: String (22.0)<br>
inclinationType: String (8.0)<br>
lowerCorner: Real (0.0)<br>
upperCorner: Real (0.0)<br>
coreCustodian: String (0.0)<br>
OGRFeature(Borehole):5<br>
gml_id (String) = gsml.borehole.WTB5<br>
name (StringList) = (2:,...)<br>
sampledFeature (String) =<br>
elevation (Real) = 45<br>
driller (String) =<br>
...<br>
<br>
Fetching with a field name of "elevation" should have worked.<br>
Check your ogrinfo report on the file and see if you see something<br>
different.<br>
<div><div></div><div><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/%7Ewarmerdam" target="_blank">http://pobox.com/~warmerdam</a><br>
and watch the world go round - Rush | Geospatial Software Developer<br>
</div></div></blockquote></div><br>