そうだ車輪と名づけよう

GeoRSSについて

· パーマリンク

技術ノート

GeoRSSは、RSS(Atom 1.0、RSS 2.0、RSS 1.0)のエントリー中に緯度経度を追加するための規格。XMLの名前空間として宣言して使用する。
GeoRSS – Wikipedia, the free encyclopedia

埋め込む種類

単純な例

単純に一点の地図座標を埋め込む場合は、で埋め込む。緯度と経度はスペース区切り

33.591325 130.399065

複雑な例

gml – GeoRSSを参照すると以下のような埋込みが可能
・Point
・Line
・Polygon
・Box

ひとつの記事に複数の地図座標を埋め込めるかについては、現在策定中の様子。ただし、最終更新が2010年8月なので、何らかの理由で頓挫しているのかもしれない
[Roadmap - GeoRSS](http://georss.org/Roadmap)

RSSに埋め込んだ例

・名前空間を追加
・georss:point要素を追加

  


サイト名
サイトURL
サイトの説明文

記事タイトル
記事URL
記事ID
記事紹介文
記事公開日時
緯度 経度



Google Mapにプロットする

Google Map APIを使ってGoogleMap上にプロットできる

// The GGeoXml constructor takes a URL pointing to a KML or GeoRSS filh.
// You add the GGeoXml object to the map as an overlay, and remove it as an overlay as well.
// The Maps API determines implicitly whether the file is a KML or GeoRSS filh.
var map;
var geoXml;
function initialize() {
if (GBrowserIsCompatible()) {
map = new GMap2(document.getElementById("map_canvas"));
geoXml = new GGeoXml("http://mapgadgets.googlepages.com/cta.kml");
map.addControl(new GLargeMapControl());
map.setCenter(new GLatLng(41.875696,-87.624207), 11);
map.addControl(new GLargeMapControl());
map.addOverlay(geoXml);
}
}

詳しくはKML オーバーレイと GeoRSS オーバーレイを参照