90 likes | 180 Views
GeoRSS and Webmaps. Really Simple Syndication. Specification. <?xml version="1.0" encoding="UTF-8"?> <rss version="2.0" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:dc="http://purl.org/dc/elements/1.1/"> <channel> <title>name of the FEED</title> <description></description>
E N D
Specification <?xml version="1.0" encoding="UTF-8"?> <rss version="2.0" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:dc="http://purl.org/dc/elements/1.1/"> <channel> <title>name of the FEED</title> <description></description> <link>http://www.your.com/FEED</link> <dc:publisher>creator's name</dc:publisher> <pubDate>2011</pubDate> <item> <title>unique item</title> <pubDate>2008-02-01</pubDate> <description><![CDATA[some formatting<br> can be done<br> in the popup]]></description> <link>http://URI.to.your.com/ITEM_HANDLE</link> <geo:lat>36.75</geo:lat> <geo:long>127.75</geo:long> </item> </channel> </rss>
Reading GeoRSS in Webmaps <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>GeoRSS Example</title> <link rel="stylesheet" type="text/css" href="openlayers_style.css"> <link rel="stylesheet" type="text/css" href="style.css"> <style type="text/css"> #map {width: 512px; height: 512px; border: 1px solid black;} </style> <script src="OpenLayers.js"></script> <script type="text/javascript"> var map, markers, layer; function init(){ map = new OpenLayers.Map('map', {controls: [new OpenLayers.Control.PanZoomBar()]}); var wms = new OpenLayers.Layer.WMS( "OpenLayers WMS", "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} ); var newl = new OpenLayers.Layer.GeoRSS( 'local GeoRSS', 'news.xml'); map.addLayer(newl); } </script> </head> <body onload="init()"> <h2>sample</h2> <div id="tags"></div> <div id="map"></div> <div id="docs"></div> </body> </html>>
Google Map Interface http://code.google.com/apis/maps/documentation/javascript/overlays.html#KMLLayers
Generating GeoRSS Feeds 1) query database and serialize results to GeoRSS 2) parse or transform existing metadata repository to generate GeoRSS
Validating GeoRSS Feeds 1) be careful to escape (or delete from feed) special characters! some diacritic marks & reserved characters will throw errors 2) validate your content as clean XML first (http://validator.w3.org/) 3) check your feed in various browsers 4) validate the GeoRSS in OpenLayers (http://openlayers.org/dev/examples/georss.html)
Pros and Cons Lightweight Easy to Automate Easy to Aggregate W3C Standard Webmap Providers Adopt OGC & Standards Adopt Web 2.0 Generic API for users Feeds abbreviated Webmaps choke on qty Feeds Load in Client OpenLayers -> Vector