Robert, Thanks much for your reply. While I did not go the route of manually defining my GML based on your example, what your example did was jog my memory: "where have I seen that before???" - mapserver WFS output of course. Since I have mapserver on my system, configured for WFS, I simply loaded the WFS layer in an open layers shell, then copied the GET for the layer in question out of the Firebug Console (thanks to a post by Arnd Wipperman on an earlier thread), and voila, I had myself a properly formatted GML file.
What's the use if I already have mapserver? Well, I have a fairly restrictive internet setup here, so I am not able to hit any of my mapserv installs, so I am experimenting with an entirely OL approach, since that is javascript and runs on the client. So far, I am very encouraged! Thanks again to Robert and Arnd for kicking the knowledge. Robert W. Burgholzer Surface Water Modeler Office of Water Supply and Planning Virginia Department of Environmental Quality [EMAIL PROTECTED] 804-698-4405 Open Source Modeling Tools: http://sourceforge.net/projects/npsource/ -----Original Message----- From: Robert Sanson [mailto:[EMAIL PROTECTED] Sent: Sunday, April 27, 2008 4:45 PM To: Burgholzer,Robert; [email protected] Subject: Re: [OpenLayers-Users] KML/GML from text file? Yes, managed to get it to work. I have some Java code that pulls a geometry out of a database (SDE) and writes it to a local file system file. Seems OL is fairly fussy about the structure of the GML file. Anyway, here is the OL code: var fbnd = new OpenLayers.Layer.GML("Farm boundary", "./farmfiles/" + farmid + ".xml", {style: farm_style}); map.addLayer(fbnd); And here is a sample GML (I experimented with GML structure using one of the OL examples that writes out GML to a text box, then emulated that): <wfs:FeatureCollection xmlns:wfs="http://www.opengis.net/wfs"> <gml:featureMember xmlns:gml="http://www.opengis.net/gml"> <feature:features xmlns:feature="http://mapserver.gis.umn.edu/mapserver" fid="OpenLayers.Feature.Vector"> <feature:geometry> <gml:Polygon> <gml:outerBoundaryIs> <gml:LinearRing> <gml:coordinates decimal="." cs=", " ts=" "> 1821412.509, 5534791.015 1821458.847, 5534735.59 1821598.037, 5534849.028 1821614.701, 5534862.607 1821673.566, 5534910.58 1821659.449, 5534927.465 1821655.449, 5534932.249 1821627.218, 5534966.016 1821412.509, 5534791.015 </gml:coordinates> </gml:LinearRing> </gml:outerBoundaryIs> </gml:Polygon> </feature:geometry> </feature:features> </gml:featureMember> </wfs:FeatureCollection> Kind regads, Robert Sanson >>> "Burgholzer,Robert" <[EMAIL PROTECTED]> 25/04/2008 5:30 a.m. >>> Has anyone loaded a simple KML/GML layer from a local text file? Maybe this is trivial . Thanks! r.b. Robert W. Burgholzer Surface Water Modeler Office of Water Supply and Planning Virginia Department of Environmental Quality [EMAIL PROTECTED] 804-698-4405 Open Source Modeling Tools: http://sourceforge.net/projects/npsource/ Click here <https://www.mailcontrol.com/sr/wQw0zmjPoHdJTZGyOCrrhg==> to report this email as spam. ------------------------------------------------------------------ The contents of this email are confidential to AsureQuality. If you have received this communication in error please notify the sender immediately and delete the message and any attachments. The opinions expressed in this email are not necessarily those of AsureQuality. This message has been scanned for known viruses before delivery. AsureQuality supports the Unsolicited Electronic Messages Act 2007. If you do not wish to receive similar communications in future, please notify the sender of this message. ------------------------------------------------------------------ This message has been scanned for malware by SurfControl plc. www.surfcontrol.com <http://www.surfcontrol.com/>
_______________________________________________ Users mailing list [email protected] http://openlayers.org/mailman/listinfo/users
