Query-to-map

From OpenStreetMap Wiki
(Redirected from DE:Query-to-map)
Jump to: navigation, search
Available languages — Query-to-map
Afrikaans Alemannisch aragonés asturianu azərbaycanca Bahasa Indonesia Bahasa Melayu Bân-lâm-gú Basa Jawa Baso Minangkabau bosanski brezhoneg català čeština dansk Deutsch eesti English español Esperanto estremeñu euskara français Frysk Gaeilge Gàidhlig galego Hausa hrvatski Igbo interlingua Interlingue isiXhosa isiZulu íslenska italiano Kiswahili Kreyòl ayisyen kréyòl gwadloupéyen kurdî latviešu Lëtzebuergesch lietuvių magyar Malagasy Malti Nederlands Nedersaksies norsk norsk nynorsk occitan Oromoo oʻzbekcha/ўзбекча Plattdüütsch polski português română shqip slovenčina slovenščina Soomaaliga suomi svenska Tiếng Việt Türkçe Vahcuengh vèneto Wolof Yorùbá Zazaki српски / srpski беларуская български қазақша македонски монгол русский тоҷикӣ українська Ελληνικά Հայերեն ქართული नेपाली मराठी हिन्दी অসমীয়া বাংলা ਪੰਜਾਬੀ ગુજરાતી ଓଡ଼ିଆ தமிழ் తెలుగు ಕನ್ನಡ മലയാളം සිංහල ไทย မြန်မာဘာသာ ລາວ ភាសាខ្មែរ ⵜⴰⵎⴰⵣⵉⵖⵜ አማርኛ 한국어 日本語 中文（简体）‎ 吴语 粵語 中文（繁體）‎ ייִדיש עברית اردو العربية پښتو سنڌي فارسی ދިވެހިބަސް

Attention: The documentation of the first version with XAPI and google maps can be found under: Query-to-map/first version.

Query-to-map is a script to show the results of an database query in a map. The used database is the same like used for the standard tile layer. The script is designed to work in real-time, so it should be used with queries returning only relatively small results.

As alternative to a map you can get also a alphabetic list.

The query must contain a bbox or a coordinate of the center. You can request points, lines and areas object types. It's possible to ask for a name, a ref, a key or key/value pair.

So the following script give you a interactive street list for the city Dresden:

It's also possible to get i.e. a motorways of a city in a map:

Beside the lines you can also get point and areas. The following map shows all churches of Dresden:

This example contains also the string "info" in parameter "types", so you get also info-ballons for all objects.

Attention: It is the job of the user to take care that the query doesn't give a too big result. So please keep the bbox so small as possible. We hope you can accept that this procedure takes sometimes some time.

If the script gets a request it does the following things:

  1. It generates a sql-command to the PostGIS database which is used for mapnik on ptolemy.toolserver.org. This query contain a bounding box and can contain, a name, a key, a value and a types-parameter.

The parameter of name, key and value can either by "*". For more info on useful parameters read Map Features.

  1. In script osm-to-kml.php the query goes directly to the post GIS database and delivers a kml-file. This kml file can also be useful in Google Earth. (For large results Google Earth is much faster than Google Maps.) Try it as network link in Google Earth:Network-Link-OSM-Mapfeatures.kml.
  • The job of queryinmap.php is it to put the kml-result into a Openlayers map.
  • The generating of the lists is part of index.php.
  • The both scripts queryinmap.php and index.php are frames inside the featurelist.php script.

Restrictions

  • There are fixed limits of 10,000 objects for a list and 1,000 objects for a map.
  • The script can only support map features of OSM which are in the database.We have now a postgresql hstore, so all key/value pairs are possible also for huge areas if the key/value-combinations are rare.
  • The datas are in the moment 3 months old (October 2009). Datas are up-to-date

Objectives

The project should show that with the free datas of OSM is more possible than with closed systems like Google Maps. The project can used for education.

The query-to-map project should show that OSM is more than drawing a wonderful map, it's also the creating of a database. Query-to-map should help to find bugs in the map, so if a part of way has no name or the false name you can see it and you can check if all object of a map-feature are in OSM. So are all cinemas, fountains and so on of your city in OSM?

Server (Wikipedia)

Currently this script is running on Wikimedias Toolserver (ptolemy). The basic idea was to use the data from OpenStreetMap to describe geographical Wikipedia-objects which are not so good to show by only one point which is the scope of Wikipedia:WikiProject Geographical coordinates. At the moment it seems perhaps more useful to concentrate the usage and benefit to Openstreetmap to start with.

Source code

To-Do

on the API side

  • Stability and performance (if a lot of wikipedia-queries will come)
  • Caching
  • Queries with a huge bounding box seems to be a problem.

output

  • find perhaps a better contrast on OSM tiles

...

on the OSM datas

  • The requirements of data base queries seem to be other than to draw a map. For instances, if a street ref=B170 going together with an other street ref=B6 than the tag is normally ref=B170/B6 for the indexing in the database it would be better to use two tags ref=B170 and ref=B6.

integration in the wiki

  • create a template to link to the script from the wiki (OSM-Wiki, Wikipedia or something else)
    • Template:Osm-query-name works already fine. Template:Osm-query was designed for the first versions of Query-to-map and was designed to work together with XAPI. The now used mapnik-database is incompatible and it was necessary to create a new template Template:Osm-query2. If it works fine as well in the next step all links have to transfered to the new one.
  • To bring this project inside the wikikpedia it would be important to support this feature also for the rendering of static maps. It should be so stable that it could run on Ptolemy (productive system).

Map Features Script

The Map Features Script is an script to generates the queries from all map features for an area and call the Query-to-map script with one mouse click. You can call the OSMhack via Template:Place or i.e for London (inner-area) by:

You have the choice between the list and the map with this features.

The content of this page based on User:Kolossos/features-page and can edit in the wiki. you can also get the sourcecode of the script.

So it'very easy to prove that all cinemas, fountains, etc. of a city have a OSM entry. You can also see the complexity of the powerline system of your town or find a place to do sports. ...

Interface to generate queries

A tiny HTML interface for those who are not comfortable with generating queries manually. Demo, Project

Creators / Contact

If you have questions or ideas please use the discussion-page. If you want to participate the project you are very welcome.

See also

Wiki Permanent Links

Overpass turbo - a easy to use map with live query

WIWOSM
{"cc_re__cc_re__cc_by_sa_2_0": ["iki</a></li>\n\t\t\t\t\t\t\t\t<li id=\"footer-places-disclaimer\"><a href=\"/wiki/OpenStreetMap:General_disclaimer\" class=\"mw-redirect\" title=\"OpenStreetMap:General disclaimer\">Disclaimers</a></li>\n\t\t\t\t\t\t\t\t<li id=\"footer-places-mobileview\"><a href=\"//wiki.openstreetmap.org/w/index.php?title=Query-to-map&amp;mobileaction=toggle_view_mobile\" class=\"noprint stopMobileRedirectToggle\">Mobile view</a></li>\n\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t\t\t<ul id=\"footer-icons\" class=\"noprint\">\n\t\t\t\t\t\t\t\t\t\t<li id=\"footer-copyrightico\">\n\t\t\t\t\t\t<a href=\"https://creativecommons.org/licenses/by-sa/2.0/\"><img src=\"/cc-wiki.png\" alt=\"Creative Commons Attribution-ShareAlike 2.0 license\" width=\"88\" height=\"31\"/></a>\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t\t\t<li id=\"footer-poweredbyico\">\n\t\t\t\t\t\t<a href=\"//www.mediawiki.org/\"><img src=\"/w/resources/assets/poweredby_mediawiki_88x31.png\" alt=\"Powered by MediaWiki\" srcset=\"/w/resources/assets/poweredby_mediawiki_132x47.png 1.5x, /w/resources/assets/poweredby_mediawiki_176x62.png 2x\" width=\"88\" height=\"31\"/></a>\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t<div style=\"clear: both;\"></div>\n\t"], "copyright__copyright__copyright": ["a city have a OSM entry. You can also see the complexity of the powerline system of your town or find a place to do sports. ...\n\nInterface to generate queries\n\nA tiny HTML interface for those who are not comfortable with generating queries manually. Demo, Project\n\nCreators / Contact\n\nIf you have questions or ideas please use the discussion-page. If you want to participate the project you are very welcome.\n\nSee also\n\nWiki Permanent Links\n\nOverpass turbo - a easy to use map with live query\n\nWIWOSM", "a city have a OSM entry. You can also see the complexity of the powerline system of your town or find a place to do sports. ...\n\nInterface to generate queries\n\nA tiny HTML interface for those who are not comfortable with generating queries manually. Demo, Project\n\nCreators / Contact\n\nIf you have questions or ideas please use the discussion-page. If you want to participate the project you are very welcome.\n\nSee also\n\nWiki Permanent Links\n\nOverpass turbo - a easy to use map with live query\n\nWIWOSM"]}