Query-to-map

From OpenStreetMap Wiki
Jump to: navigation, search
Attention: In the moment I rewrite these scripts completely, so they become independent of XAPI and Google Maps. The old documentation can found under: Query-to-map/first version. So this documentation is perhaps not up to date.
Kolossos, 25 October 2009


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 mapnik. 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.

Contents

restrictions

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

output

...

on the OSM datas

integration in the wiki

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. ...

Creators / Contact

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

Personal tools
Namespaces
Variants
Actions
site
Toolbox