[gdal-dev] GML elevation

Frank Warmerdam warmerdam at pobox.com
Mon Aug 8 21:18:29 EDT 2011


On Mon, Aug 8, 2011 at 5:09 PM, Nikolaos Hatzopoulos <nhatzop at gmail.com> wrote:
> Hi Community,
>
> we have this gml data:
> http://nvclwebservices.vm.csiro.au/geoserverBH/wfs?SERVICE=WFS&REQUEST=GetFeature&VERSION=1.1.0&maxFeatures=1&typeName=gsml:Borehole
>
> System.out.println("Layer Count: "+poDS.GetLayerCount());
> System.out.println("Layer Name: "+poDS.GetLayerByIndex(0).GetName());
> System.out.println("Feature Count:
> "+poDS.GetLayerByIndex(0).GetFeatureCount());
> System.out.println("1st Feature X:
> "+Double.toString(poDS.GetLayerByIndex(0).GetFeature(0).GetGeometryRef().GetX()));
> System.out.println("1st Feature Y:
> "+Double.toString(poDS.GetLayerByIndex(0).GetFeature(0).GetGeometryRef().GetY()));
>

I imagine something like:

System.out.println(poDS.GetLayerByIndex(0).GetFeature(0).GetFieldAsString("elevation"));

BTW, refetching the feature each time may be quite expensive!

Best regards,

-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Software Developer


More information about the gdal-dev mailing list