Achei bem bacana, vejam só: http://www.openstreetmap.pl/wp

[]

---------- Forwarded message ----------
From: andrzej zaborowski <balr...@gmail.com>
Date: 2009/9/30
Subject: [OSM-talk] Overlay showing wikipedia links
To: Talk Openstreetmap <t...@openstreetmap.org>


Hi,

seeing that features that get visualised in some form somewhere (e.g.
on a slippymap on the web) get mapped more often than other features,
I've set up an overlay that shows the External Links (proposal at
[1]), most importantly links to wikipedia pages [2] directly from
objects in OSM.

It's at http://www.openstreetmap.pl/wp (see caveats below).

I want to encourage the use of the wikipedia= tag, I think it gets us
a little closer the the Tim Berners-Lee's "Linked Data".  The overlay
has been on my todo list for for a long time, I think other people
have had the same idea.  I first saw a wikipedia overlay implemented
at targeo.pl, a commercial map provider for Poland, long before
google.

Limitations:

 * the page probably doesn't work in browsers other than Firefox
because I have not used OpenLayers with its nice browser compatibility
features like VML support.

 * it will happily load more objects than the recommended maximum into
the browser's memory if you zoom into a place with a high wikipedia=
density.

 * USA is not imported because I have had problems with some PostGIS
queries returning things like:

NOTICE:  TopologyException: side location conflict -1.28212e+07 4.29532e+06
ERROR:  GEOS intersects() threw an error!

 It's the ST_Intersects function causing the errors and I can't tell
whether it's a problem with osm2pgsql or PostGIS itself.  Surely
PostGIS should prevent incorrect geometries to be loaded into the
database?

 * Other things may be broken.


Features:

 * Blue dots are wikipedia links, grey dots are other External Links
(website= and url= tags).  The wikipedia= value syntax is
"<two-letter-code>:Title" or "Title" alone for English wikipedia.  It
doesn't matter which wikipedia language you link to, the page is
always displayed in your chosen language, if available.

 * Ways and polygons tagged with wikipedia= are also displayed, my
city has especially many buildings, parks and other areas tagged this
way by myself and user:Mala.  UK has some and US has a bunch of town
boundaries tagged this way (but you can't see USA there).

 http://www.openstreetmap.pl/wp?lat=52.2294&lon=21.0216&zoom=13 -
move mouse over the city, zoom in and out to see up to individual
buildings and streets, especially around here:
http://www.openstreetmap.pl/wp?lat=52.23935&lon=21.0131&zoom=16 (at
this point the page becomes hard to use.. but since it's only for
show...)

 * The features data is tiled in the hope that the tiles will be
cached by the browser.  There are 6 zoom levels.  The continents level
does not come from data in OSM.

 * You can zoom further than mapnik tiles go, up to z20 to have the
tiles enlarged up to a point where they look really ugly ([3]) but
perhaps good from accessibility standpoint.  I based on Bernhard
Zwischenbrugger's excellent zoom zoom zoom map instead of OpenLayers.
Perhaps I'm just really bad at using OpenLayers but there are a couple
of things I just couldn't figure out how to implement in OpenLayers.
The wikipedia overlay alone would probably be trivial to do in OL
though.  Contrary to OL my wikipedia layer supports tile retrieval
through both XMLHttpRequest or JSON-P.  (JSON-P will probably kill
browser caching though)

 * The first picture from every wikipedia page is displayed.  As you
will notice, this is not always such a good idea.

 * Last week I implemented a couple of redirects that you can use in
your web apps for the "<language-code>:Title" style wikipedia links,
they're explained in [4] in Polish.  I can document them on the wiki
if there's demand.  In a nutshell:

 "http://wp.openstreetmap.pl/fr:16e arrondissement de Paris"
redirects to http://en.wikipedia.org/wiki/16th_arrondissement_of_Paris
if your browser language is set to English.
 "http://en.wp.openstreetmap.pl/fr:16e arrondissement de Paris"
redirects to http://en.wikipedia.org/wiki/16th_arrondissement_of_Paris
always.
 "http://en.cached-wp.openstreetmap.pl/fr:16e arrondissement de
Paris" redirects to
http://en.wikipedia.org/wiki/16th_arrondissement_of_Paris using a 301
HTTP redirect.  The Wikipedia API query is done on my pc instead of
your browser, and the response cached.
 "http://image.openstreetmap.pl/fr:16e arrondissement de Paris"
redirects to the first image on the page using a HTTP 301 - you can
use this URL in a <img src="..." /> tag.

 Only wikipedias with a two-letter code are supported for the moment.

Cheers
---
1. http://wiki.openstreetmap.org/wiki/Proposed_features/External_links
2. http://wiki.openstreetmap.org/wiki/Key:wikipedia
3. http://www.openstreetmap.pl/wp?lat=52.236473&lon=21.015239&zoom=19
4. http://forum.openstreetmap.org/viewtopic.php?pid=38233#p38233

_______________________________________________
talk mailing list
t...@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk



-- 
Arlindo Saraiva Pereira Jr.

Bacharelando em Sistemas de Informação - UNIRIO - uniriotec.br
Consultor de Software Livre da Uniriotec Consultoria - uniriotec.com

Acadêmico: arlindo.pere...@uniriotec.br
Profissional: arlindo.pere...@uniriotec.com
Geral: cont...@arlindopereira.com
Tel.: +5521 92504072
Jabber/Google Talk: nig...@nighto.net
Skype: nighto_sumomo
Chave pública: BD065DEC
_______________________________________________
Talk-br mailing list
Talk-br@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk-br

Responder a