[OpenLayers-Dev] GML 3.2.1, <Ring> and <LineStringSegment>

Steven Ottens steven at minst.net
Fri Sep 24 07:52:16 EDT 2010


Hi Bart,

Thanks, I didn't think it would be so easy ;)

"Ring": function(node, obj) {
                var container = {};
                this.readChildNodes(node, container);
                obj.components = [new OpenLayers.Geometry.LinearRing(
                    container.components[0].getVertices()
                )];
            },

does the trick


On Sep 24, 2010, at 1:44 PM, Bart van den Eijnden (OSGIS) wrote:

> Hi Steven,
> 
> how about getVertices?
> 
> Best regards,
> Bart
> 
>> Hi all,
>> 
>> I've got a GML 3.2.1 response which uses:
>> <MultiSurface><surfaceMember><Surface><patches><PolygonPatch><exterior>
>> <Ring><curveMember><Curve><segments><LineStringSegment><posList>
>> 
>> Which unfortunately is a valid in an insane GML kind of way.  The trouble
>> I have is that OpenLayers parses the posList as a
>> OpenLayers.Geometry.LineString, since it is a LineStringSegment. However
>> the Polygon geometry expects a OpenLayers.Geometry.LinearRing.
>> I've added a "Ring" reader to Format.GML.v3:
>> "Ring": function(node, obj) {
>>                var container = {};
>>                this.readChildNodes(node, container);
>>                obj.components = [new OpenLayers.Geometry.LinearRing(
>>                    container.points
>>                )];
>>            },
>> 
>> But the container which is passed on from the LineStringSegment reader
>> does not contain points anymore, but a LineString component.
>> 
>> Is there a way to get the points out of this LineString component? Or does
>> anyone have an alternative approach?
>> 
>> regards,
>> Steven
>> _______________________________________________
>> Dev mailing list
>> Dev at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/openlayers-dev
>> 
> 
> 




More information about the Dev mailing list