[OpenLayers-Users] getting features from GML.v3().read()
Bart van den Eijnden
bartvde at boundlessgeo.com
Wed Nov 12 09:57:13 PST 2014
Hey Huub,
try calling readNode directly. Since these are geometries only and not features, read will probably not work.
See the GML/v3 testcases for examples.
Best regards,
Bart
Bart van den Eijnden
Front End Software Engineer | Boundless
bartvde at boundlessgeo.com
1-877-673-6436
@boundlessgeo
On 12 Nov 2014, at 16:29, Huub Fleuren <huub.gis at gmail.com> wrote:
> Hi List,
>
> I was trying to read the following GML text with the Format.GML.v3
>
> <?xml version="1.0" encoding="UTF-8"?>
> <gml:MultiGeometry xmlns:gml="http://www.opengis.net/gml"
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns:xlink="http://www.w3.org/1999/xlink"
> xmlns:sch="http://www.ascc.net/xml/schematron" srsDimension="2">
> <gml:geometryMember>
> <gml:Polygon srsDimension="2">
> <gml:exterior>
> <gml:LinearRing srsDimension="2">
> <gml:posList>115.0 15.5 118.0 16.0 118.0 18.0 113.0 17.166666666666668 112.0 18.0 114.5 20.0 120.0 20.0 120.0 10.0 116.2 10.0 118.0 13.0 115.0 15.5
> </gml:posList>
> </gml:LinearRing>
> </gml:exterior>
> </gml:Polygon>
> </gml:geometryMember>
> <gml:geometryMember>
> <gml:Polygon srsDimension="2"><gml:exterior><gml:LinearRing srsDimension="2">
> <gml:posList>115.0 15.5 118.0 13.0 116.2 10.0 110.0 10.0 110.0 20.0 114.5 20.0 112.0 18.0 113.0 17.166666666666668 112.0 17.0 112.0 15.0 115.0 15.5
> </gml:posList>
> </gml:LinearRing>
> </gml:exterior>
> </gml:Polygon>
> </gml:geometryMember>
> </gml:MultiGeometry>
>
> code:
> var gml = new OpenLayers.Format.GML.v3();
> var features = gml.read(GMLtext);
>
>
> Apparently this is parsed correctly by Format.XML, but i never get a list of features from the read () function.
>
> Is it possible? How?
>
> Regards, Huub
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20141112/1ce29413/attachment.html>
More information about the Users
mailing list