UserAndre Castro/maps01

From XPUB & Lens-Based wiki

Maps

I have recently found open street maps. Not only it is a open-source project that allows users to search and find place, but also anyone to contribute for the improvement of the maps, and it allowing geographical data to be easily retrieved.


I would explore its potential to create non-functional maps or trajectories that could open new perspectives on the city space. (situationists echos)



Map Making using Open Street Map

  • installed osmarender


ask for the geographical data

  • find coordinates

In openstreetmap.org go to Export Menu and check the coordinates. they organized as [lat,long, lat++, long++] area[1,3,2,0] or in other works [lat,long, lat++, long++]


  • wget that area's data
wget -O data.osm "http://api.openstreetmap.org/api/0.6/map?bbox=4.4552603823670465,51.91739525301985,4.46384345121436,51.920373035178464"


render the data into an svg

  • mv this data.osm file into the same the osmarender dir
  • call osmarender to process the data.osm into a rendered svg image
    • osm-map-features-z17.xml tells what to put on the map - CAN BE EDITED in order to change the result
    • osmarender.xsl a stylesheet that directs the actual rendering work - DON'T MESS WITH IT!
    • xsltproc applies XSLT stylesheets to XML documents.
	
xsltproc osm-map-features-z17.xml > rendered-map.svg

tanttttaaaaaa! the svg! Render-rotterdam-04.svg


data filtering

osmfilter can also be used to include or exclude certain map data


  • Info sources:

http://www.use-it.be/europe/docs/OSMmanual/

http://wiki.openstreetmap.org/wiki/Osmarender

Getting Data

Other Possibilities

  • GPS traces
  • Topographic map


OSM Elements

source: http://wiki.openstreetmap.org/wiki/Map_Features

maps are made up of a few simple elements (Data primitives): nodes, ways and relations. Each element may have an arbitrary number of properties (a.k.a. Tags) which are Key-Value pairs (e.g. highway=primary). (All editing interfaces use the elements and allow the input of tags. )


NODE - the basic element, building block. Nodes consist of latitude and longitude (Nodes are needed to define a way, but a node can also be a standalone unconnected point representing something or points of interest (POI). Standalone nodes should always have at least one Tag such as amenity=telephone). Example <node id="25496583" lat="51.5173639" lon="-0.140043" version="1" changeset="203496" user="80n" uid="1238" visible="true" timestamp="2007-01-28T11:40:26Z"><tag k="highway" v="traffic_signals"/> </node>


WAY - ordered interconnection of at least 2 or more nodes can describe a street, footpath, railway line, river, fence, power line, area or building outline. CLOSED WAY - the first and last nodes are identical, enclosing an AREA



XAPI - Retrieve Particular Data Request Needs to be edited

To acess data of a given area in http://www.openstreetmap.org/ go to Export Menu and check the coordinates. they organized as [bbox=lat,long, lat++, long++] area[1,3,2,0] or in other works [lat,long, lat++, long++]

EXAMPLES:

search all nodes in a small are in west Rotterdam:

wget http://open.mapquestapi.com/xapi/api/0.6/node[bbox=4.4552603823670465,51.91739525301985,4.46384345121436,51.920373035178464] -O rotterdam-west-test.osm


search pub nodes in Rotterdam

wget http://open.mapquestapi.com/xapi/api/0.6/node[amenity=pub][bbox=4.3142405612056836,51.87797066611181,4.588898764319719,51.973245376533505] -O rotterdam-pub-test.osm


search ways in a small area in west Rotterdam:

wget http://open.mapquestapi.com/xapi/api/0.6/way[bbox=4.4552603823670465,51.91739525301985,4.46384345121436,51.920373035178464] -O rotterdam-west-way-test.osm


Ways are where I can gather information about streets

Ways get rendered as streets/railways/footpaths/canals etc according to the tag(s) indicating what type of way it is. Ways are contiguous and non-branching. (You can get from beginning to end by following segments of the way, without "jumping" or backtracing)


eg: <tag k="addr:street" v="Mauritsstraat"/>


eg:

 <way id="5090250" visible="true" timestamp="2009-01-19T19:07:25Z" version="8" changeset="816806" user="Blumpsy" uid="64226">
   <nd ref="822403"/>
   <nd ref="21533912"/>
   <nd ref="821601"/>
   <nd ref="21533910"/>
   <nd ref="135791608"/>
   <nd ref="333725784"/>
   <nd ref="333725781"/>
   <nd ref="333725774"/>
   <nd ref="333725776"/>
   <nd ref="823771"/>
   <tag k="highway" v="unclassified"/>
   <tag k="name" v="Clipstone Street"/>
   <tag k="oneway" v="yes"/>
 </way>


All Elements

All elements (nodes, ways and relations) that match the given filter predicates can be requested using the following URL:

http://www.informationfreeway.org/api/0.6/*[...]

This returns an xml document containing nodes, ways and relations that match the search terms. For each matching way the nodes and referenced by that way are also returned. Likewise, for each matching relation the ways and nodes referenced by that relation are also returned.

Source: http://wiki.openstreetmap.org/wiki/Xapi


relevant links

http://derickrethans.nl/what-is-openstreetmap.html Good explanation of OSM project

http://weait.com/content/openstreetmap-planet-file

http://derickrethans.nl/spatial-indexes-data-sqlite.html