有没有一种简单的方法来创建像 Google GeoRSS 这样的地理 RSS?
这是“我的地图”中的 Google GeoRSS:
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml">
<channel>
<link>http://maps.google.com</link>
<title>beijing 1</title>
<description><![CDATA[dsad]]></description>
<item>
<guid isPermaLink="false">00048b5b66b7169311de4</guid>
<pubDate>Wed, 14 Jul 2010 16:23:08 +0000</pubDate>
<title>ww</title>
<description><![CDATA[<div dir="ltr">dwqd</div>]]></description>
<author>zjm1126</author>
<georss:point>
39.965015 116.362381
</georss:point>
<georss:elev>0.000000</georss:elev>
</item>
<item>
<guid isPermaLink="false">00048b5b6a51f18e53ea5</guid>
<pubDate>Wed, 14 Jul 2010 16:24:08 +0000</pubDate>
<title>线条 1</title>
<description><![CDATA[]]></description>
<author>zjm1126</author>
<gml:LineString>
<gml:posList>
39.992191 116.417938
39.968254 116.466698
39.939568 116.451591
39.959045 116.411079
</gml:posList>
</gml:LineString>
</item>
<item>
<guid isPermaLink="false">00048b5b6a520c46d52bd</guid>
<pubDate>Wed, 14 Jul 2010 16:24:08 +0000</pubDate>
<title>线条 2</title>
<description><![CDATA[<br>]]></description>
<author>zjm1126</author>
<gml:LineString>
<gml:posList>
39.990536 116.437225
39.963963 116.477051
39.958702 116.437912
39.959045 116.411079
</gml:posList>
</gml:LineString>
</item>
<item>
<guid isPermaLink="false">00048b5b6a521daa5391e</guid>
<pubDate>Wed, 14 Jul 2010 16:24:08 +0000</pubDate>
<title>qqdw</title>
<description><![CDATA[dsa]]></description>
<author>zjm1126</author>
<gml:LineString>
<gml:posList>
39.987720 116.519913
39.947990 116.556641
39.959045 116.523003
</gml:posList>
</gml:LineString>
</item>
<item>
<guid isPermaLink="false">00048b5b6a52357ab39f0</guid>
<pubDate>Wed, 14 Jul 2010 16:24:08 +0000</pubDate>
<title>dwqd</title>
<description><![CDATA[]]></description>
<author>zjm1126</author>
<gml:Polygon>
<gml:exterior>
<gml:LinearRing>
<gml:posList>
40.034264 116.451241
40.015781 116.437225
40.011654 116.409363
40.033478 116.430305
40.034264 116.451241
</gml:posList>
</gml:LinearRing>
</gml:exterior>
</gml:Polygon>
</item>
</channel>
</rss>
两个问题:
是否有一个库可以执行此操作?
Google 使用 RSS,但我认为 Atom 更好。如何创建 GeoAtom?
This is Google GeoRSS which in "my maps":
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml">
<channel>
<link>http://maps.google.com</link>
<title>beijing 1</title>
<description><![CDATA[dsad]]></description>
<item>
<guid isPermaLink="false">00048b5b66b7169311de4</guid>
<pubDate>Wed, 14 Jul 2010 16:23:08 +0000</pubDate>
<title>ww</title>
<description><![CDATA[<div dir="ltr">dwqd</div>]]></description>
<author>zjm1126</author>
<georss:point>
39.965015 116.362381
</georss:point>
<georss:elev>0.000000</georss:elev>
</item>
<item>
<guid isPermaLink="false">00048b5b6a51f18e53ea5</guid>
<pubDate>Wed, 14 Jul 2010 16:24:08 +0000</pubDate>
<title>线条 1</title>
<description><![CDATA[]]></description>
<author>zjm1126</author>
<gml:LineString>
<gml:posList>
39.992191 116.417938
39.968254 116.466698
39.939568 116.451591
39.959045 116.411079
</gml:posList>
</gml:LineString>
</item>
<item>
<guid isPermaLink="false">00048b5b6a520c46d52bd</guid>
<pubDate>Wed, 14 Jul 2010 16:24:08 +0000</pubDate>
<title>线条 2</title>
<description><![CDATA[<br>]]></description>
<author>zjm1126</author>
<gml:LineString>
<gml:posList>
39.990536 116.437225
39.963963 116.477051
39.958702 116.437912
39.959045 116.411079
</gml:posList>
</gml:LineString>
</item>
<item>
<guid isPermaLink="false">00048b5b6a521daa5391e</guid>
<pubDate>Wed, 14 Jul 2010 16:24:08 +0000</pubDate>
<title>qqdw</title>
<description><![CDATA[dsa]]></description>
<author>zjm1126</author>
<gml:LineString>
<gml:posList>
39.987720 116.519913
39.947990 116.556641
39.959045 116.523003
</gml:posList>
</gml:LineString>
</item>
<item>
<guid isPermaLink="false">00048b5b6a52357ab39f0</guid>
<pubDate>Wed, 14 Jul 2010 16:24:08 +0000</pubDate>
<title>dwqd</title>
<description><![CDATA[]]></description>
<author>zjm1126</author>
<gml:Polygon>
<gml:exterior>
<gml:LinearRing>
<gml:posList>
40.034264 116.451241
40.015781 116.437225
40.011654 116.409363
40.033478 116.430305
40.034264 116.451241
</gml:posList>
</gml:LinearRing>
</gml:exterior>
</gml:Polygon>
</item>
</channel>
</rss>
Two questions:
Is there a lib to do this?
Google use RSS, but I think Atom is better. How can I create a GeoAtom?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
GeoRSS 可以与 RSS 或 Atom 一起使用(请参阅 GeoRSS 维基百科页面中的示例) 。
一般来说,有许多库可以使用 RSS/Atom 提要,具体取决于您选择的语言。
处理 GeoRSS 的两个库是 OGR/GDAL,如果您使用的是 Django, GeoDjango (支持 地理提要。
GeoRSS can be used with RSS or Atom (see the example from the GeoRSS wikipedia page).
There are many libraries that work with RSS/Atom feeds in general, depending on your language of choice.
Two libraries that handle GeoRSS are OGR/GDAL and, if you're using Django, GeoDjango (which supports geographic feeds.