Is it also possible to do a reverse of that? I have this GML string:
<gml:MultiPoint srsName="http://www.opengis.net/gml/srs/epsg.xml#28992"><gml:pointMember><gml:Point><gml:coordinates xmlns:gml="http://www.opengis.net/gml" decimal="." cs="," ts=" ">203236.64977406,464492.34165434</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates xmlns:gml="http://www.opengis.net/gml" decimal="." cs="," ts=" ">220559.86535174,404337.17345485</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates xmlns:gml="http://www.opengis.net/gml" decimal="." cs="," ts=" ">306760.47770758,372675.14445673</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates xmlns:gml="http://www.opengis.net/gml" decimal="." cs="," ts=" ">373076.72169331,469050.83303507</gml:coordinates></gml:Point></gml:pointMember></gml:MultiPoint> And i want i to convert to a Openlayers.Geometry.MultiPoint object... Greetz, Lucas ________________________________ Van: Arnd Wippermann [[email protected]] Verzonden: donderdag 1 maart 2012 18:37 Aan: Lucas Heezen - Covadis CC: [email protected] Onderwerp: AW: [OpenLayers-Users] GeometryCollection to GML Hi, create a feature from your geometry and save that. var geometry_collection = new OpenLayers.Geometry.MultiPoint(); var fts=vectorLayer.features; for(var i=0;i<fts.length;i++) geometry_collection.addPoint(fts[i].geometry); var writer = new OpenLayers.Format.GML(); var feature = new OpenLayers.Feature.Vector(); feature.geometry = geometry_collection; var gml = writer.write(feature); alert(gml); Arnd ________________________________ Von: [email protected] [mailto:[email protected]] Im Auftrag von Lucas Heezen - Covadis Gesendet: Donnerstag, 1. März 2012 09:33 An: openlayers list Betreff: [OpenLayers-Users] GeometryCollection to GML Hello, Is it possible to convert a geometry.collection (multipoint) to gml? This is what I have so far: var geometry_collection = new OpenLayers.Geometry.MultiPoint(); vectorLayer.features.each(function(ff, index) { geometry_collection.addPoint(ff.geometry); }); var writer = new OpenLayers.Format.GML(); var gml = writer.buildGeometry.multipoint(geometry_collection); alert(gml); But is get the following error: this.createElementNS is not a function Met vriendelijke groet, Lucas Heezen [Beschrijving: http://www.covadis.nl/emailkop/logo.gif] Covadis b.v. t: 026 3616600 Geograaf 12 f: 026 3612317 6921 EW Duiven e: [email protected]<mailto:[email protected]>
<<inline: image001.gif>>
_______________________________________________ Users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/openlayers-users
