I am just trying to spit out some information through the GML Parser example so that I can use the bounding boxes in a search query. I have followed the example located here - http://dev.openlayers.org/releases/OpenLayers-2.10/examples/GMLParser.html and I am using my own XML file which seems to be working ok. Unfortunately my XML file has a bit different information when it comes to Geometry coordinates, for each Feature of mine (I am trying to get Neighbourhood features and basically it has neighourhood name, geometry etc) it spits out what seems like the correct info from the lines html += "Feature: Geometry: "+ features[feat].geometry+",";
Except I am having an issue. See each one of my geometries has the correct bounding box above it which goes like - <gml:boundedBy> <gml:Box srsName="EPSG:4326"> <gml:coordinates>5786792.2831552,6983.36579454902 5799746.97353866,17582.612872094</gml:coordinates> </gml:Box> </gml:boundedBy> <gml:featureMember> <gmgml:Neighbourhoods fid="Neighbourhoods.18"> <gmgml:NEIGHBOURHOODID>18</gmgml:NEIGHBOURHOODID> <gmgml:NEIGHBOURHOOD_NAME>Fairview</gmgml:NEIGHBOURHOOD_NAME> <gmgml:LABEL_LINE1>Fairview</gmgml:LABEL_LINE1> <gmgml:LABEL_LINE3> </gmgml:LABEL_LINE3> <gmgml:YearBuilt>1973.82763980659</gmgml:YearBuilt> <gmgml:Geometry> <gml:Polygon srsName="EPSG:4326"> <gml:outerBoundaryIs> <gml:LinearRing> <gml:coordinates> There is a whole bunch of coordinates here</gml:coordinates> </gml:LinearRing> </gml:outerBoundaryIs> </gml:Polygon> </gmgml:Geometry> </gmgml:Neighbourhoods> </gml:featureMember> Sorry for the big mess there but basically what I am trying to do is get the first <gml:boundedBy> value instead of the whole <gml:LinearRing><gml:coordinates> (which is a whole bunch of coordinates which I am guessing is just the area around my feature) because when I zoom into these first bounded by coordinates it is indeed in the correct area for the neighbourhood. Well I cannot get the GML parser to ignore my other geometry and just spit out this bounding box stuff. I tried going like - html += "Feature: Geometry: "+ features[feat].boundedBy+","; But now instead of displaying the neighbourhood stuff with the huge list of LinearRing coordinates it goes - Feature: Geometry: undefined, NEIGHBOURHOODID:18 NEIGHBOURHOOD_NAME:Fairview LABEL_LINE1:Fairview LABEL_LINE3:null YearBuilt:1973.82763980659 etc. So I'm just wondering can I modify the code so that it spits out the geometry inside the BoundedBy instead? Appreciate any advice hope this makes somewhat sense as I am very confused about this topic. -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/Question-on-Using-GML-Parser-with-an-XML-file-changing-output-tp5615902p5615902.html Sent from the OpenLayers Users mailing list archive at Nabble.com. _______________________________________________ Users mailing list us...@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/openlayers-users