[OpenLayers-Users] getting features from GML.v3().read()

Huub Fleuren huub.gis at gmail.com
Thu Nov 13 05:21:45 PST 2014


Oh ,but it works if I do it like so:

var gml = new OpenLayers.Format.GML();
gml.featureName="geometryMember"
var features = gml.read(data);

Thanks, great stuff ;-)

On Thu, Nov 13, 2014 at 1:18 PM, Bart van den Eijnden <
bartvde at boundlessgeo.com> wrote:

> Okay I see the issue now, there is no reader for MultiGeometry probably
> since the reader is limited to only the Simple Features profile.
>
> Bart
>
> On Thu, Nov 13, 2014 at 12:33 PM, Huub Fleuren <huub.gis at gmail.com> wrote:
>
>> Bart man,
>> The problem is in readNode. It will select only "gml:featureMembers".
>> Tweaking with these names, or adding new names to the reader list, does
>> not help. Even though componentlists are filled readingNodes, the features
>> list remains empty.
>>
>> Huub
>>
>> On Wed, Nov 12, 2014 at 6:57 PM, Bart van den Eijnden <
>> bartvde at boundlessgeo.com> wrote:
>>
>>> 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 <http://boundlessgeo.com/>
>>> bartvde at boundlessgeo.com
>>> 1-877-673-6436 <917-460-7207>
>>> @boundlessgeo <http://twitter.com/boundlessgeo/>
>>>
>>> <http://boundlessgeo.com>
>>>
>>> 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/20141113/8803ff7c/attachment.html>


More information about the Users mailing list