System.out.println("Elevation"+poDS.GetLayerByIndex(0).GetFeature(0).GetFieldAsString("elevation"));<br><br>ERROR 1: No such a field 'elevation'<br><br>I am refetching to find where in the tree is the elevation :) yes I know is expensive<br>
<br>does it has to do with the version I am using? I am using 1.7.2<br><br>--Nikos<br><br><div class="gmail_quote">On Mon, Aug 8, 2011 at 6:18 PM, Frank Warmerdam <span dir="ltr"><<a href="mailto:warmerdam@pobox.com">warmerdam@pobox.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">On Mon, Aug 8, 2011 at 5:09 PM, Nikolaos Hatzopoulos <<a href="mailto:nhatzop@gmail.com">nhatzop@gmail.com</a>> wrote:<br>
> Hi Community,<br>
><br>
> we have this gml data:<br>
> <a href="http://nvclwebservices.vm.csiro.au/geoserverBH/wfs?SERVICE=WFS&REQUEST=GetFeature&VERSION=1.1.0&maxFeatures=1&typeName=gsml:Borehole" target="_blank">http://nvclwebservices.vm.csiro.au/geoserverBH/wfs?SERVICE=WFS&REQUEST=GetFeature&VERSION=1.1.0&maxFeatures=1&typeName=gsml:Borehole</a><br>
><br>
> System.out.println("Layer Count: "+poDS.GetLayerCount());<br>
> System.out.println("Layer Name: "+poDS.GetLayerByIndex(0).GetName());<br>
> System.out.println("Feature Count:<br>
> "+poDS.GetLayerByIndex(0).GetFeatureCount());<br>
> System.out.println("1st Feature X:<br>
> "+Double.toString(poDS.GetLayerByIndex(0).GetFeature(0).GetGeometryRef().GetX()));<br>
> System.out.println("1st Feature Y:<br>
> "+Double.toString(poDS.GetLayerByIndex(0).GetFeature(0).GetGeometryRef().GetY()));<br>
><br>
<br>
</div>I imagine something like:<br>
<br>
System.out.println(poDS.GetLayerByIndex(0).GetFeature(0).GetFieldAsString("elevation"));<br>
<br>
BTW, refetching the feature each time may be quite expensive!<br>
<br>
Best regards,<br>
<font color="#888888"><br>
--<br>
---------------------------------------+--------------------------------------<br>
I set the clouds in motion - turn up | Frank Warmerdam, <a href="mailto:warmerdam@pobox.com">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>
</font></blockquote></div><br>