Difference between revisions of "Mapserver rewrite"

From Navit's Wiki
Jump to: navigation, search
m
 
(One intermediate revision by the same user not shown)
Line 14: Line 14:
  
 
=== New API (v2) ===
 
=== New API (v2) ===
 +
 +
The new API is a HTTP-GET API (you can probably call it RESTfull)
 +
 
All URLs which are supported:
 
All URLs which are supported:
 
{| class="wikitable"
 
{| class="wikitable"
Line 20: Line 23:
 
|/api/v2/areas||Defaults to json output of all areas||
 
|/api/v2/areas||Defaults to json output of all areas||
 
|-
 
|-
|/api/v2/areas/json||Output of all known areas (countries)||
+
|/api/v2/areas/:responseformat||Defaults to json output of all areas||/api/v2/areas/json
|-
 
|/api/v2/areas/xml||Output of all known areas as xml||
 
 
|-
 
|-
|/api/v2/areas/csv||Output of all known areas as csv||
+
|||||
 
|-
 
|-
 
|/api/v2/download/bbox/:xmin/:xmax/:ymin/:ymax||||
 
|/api/v2/download/bbox/:xmin/:xmax/:ymin/:ymax||||
 
|-
 
|-
 
|/api/v2/download/bbox/:xmin/:xmax/:ymin/:ymax/:format||||
 
|/api/v2/download/bbox/:xmin/:xmax/:ymin/:ymax/:format||||
|-
 
|/api/v2/download/area/||||
 
 
|-
 
|-
 
|/api/v2/download/area/id/:id/||||
 
|/api/v2/download/area/id/:id/||||
Line 36: Line 35:
 
|/api/v2/download/area/id/:id/:format||||
 
|/api/v2/download/area/id/:id/:format||||
 
|-
 
|-
|/api/v2/download/area/name/:name||||
+
|/api/v2/download/area/name/:areaname||||
 
|-
 
|-
 
+
|/api/v2/download/area/name/:areaname/:format||||
|/api/v2/download/area/name/:name/:format||||
+
|-
 +
|||||
 +
|-
 +
|/api/v2/filesize/bbox/:xmin/:xmax/:ymin/:ymax/||||/api/v2/filesize/bbox/-180/180/-90/90/
 +
|-
 +
|/api/v2/filesize/bbox/:xmin/:xmax/:ymin/:ymax/:format||||/api/v2/filesize/bbox/-180/180/-90/90/planet.bin
 +
|-
 +
|/api/v2/filesize/area/name/:areaname||Outputs the filesize of the downloadable area given by its area name. Defaults to json||
 +
|-
 +
|/api/v2/filesize/area/name/:areaname/:responseformat||Outputs the filesize of the downloadable area given by its area name in the supplied response format||
 
|-
 
|-
|/api/v2/filesize/bbox/:xmin/:xmax/:ymin/:ymax/||||
+
|/api/v2/filesize/area/id/:id||Outputs the filesize of the downloadable area given by its id. Defaults to json||
 
|-
 
|-
|/api/v2/filesize/bbox/:xmin/:xmax/:ymin/:ymax/:format||||
+
|/api/v2/filesize/area/id/:id/:responseformat||Outputs the filesize of the downloadable area given by its id in the supplied response format||
 
|-
 
|-
 
|}
 
|}
Line 51: Line 59:
 
|Parameter||Value
 
|Parameter||Value
 
|-
 
|-
|:format||bin | bin2
+
|:responseformat||json | xml
 +
|-
 +
|:format||bin | bin2 | a UTF-8 filename ending with ".bin|.bin2"
 +
|-
 +
|:areaname||The name of an area from the area list (names should be static but can change so if a name does not work anymore look into the area list -> /api/v2/areas)
 +
|-
 +
|:id||The ID of an area from the area list. IDs will change on every map update so make sure to look them up before you download a map in order to get the newest available map.
 
|-
 
|-
 
|:xmin | :xmax||Any value between -180 and 180
 
|:xmin | :xmax||Any value between -180 and 180

Latest revision as of 15:54, 21 November 2017


APIs[edit]

Old API (v1)[edit]

Example:

/api/map/?bbox=-180,-90,180,90&split=1048576000&part=0

New API (v2)[edit]

The new API is a HTTP-GET API (you can probably call it RESTfull)

All URLs which are supported:

URL Description Example
/api/v2/areas Defaults to json output of all areas
/api/v2/areas/:responseformat Defaults to json output of all areas /api/v2/areas/json
/api/v2/download/bbox/:xmin/:xmax/:ymin/:ymax
/api/v2/download/bbox/:xmin/:xmax/:ymin/:ymax/:format
/api/v2/download/area/id/:id/
/api/v2/download/area/id/:id/:format
/api/v2/download/area/name/:areaname
/api/v2/download/area/name/:areaname/:format
/api/v2/filesize/bbox/:xmin/:xmax/:ymin/:ymax/ /api/v2/filesize/bbox/-180/180/-90/90/
/api/v2/filesize/bbox/:xmin/:xmax/:ymin/:ymax/:format /api/v2/filesize/bbox/-180/180/-90/90/planet.bin
/api/v2/filesize/area/name/:areaname Outputs the filesize of the downloadable area given by its area name. Defaults to json
/api/v2/filesize/area/name/:areaname/:responseformat Outputs the filesize of the downloadable area given by its area name in the supplied response format
/api/v2/filesize/area/id/:id Outputs the filesize of the downloadable area given by its id. Defaults to json
/api/v2/filesize/area/id/:id/:responseformat Outputs the filesize of the downloadable area given by its id in the supplied response format

Parameter:

Parameter Value
:responseformat json | xml
:format bin | bin2 | a UTF-8 filename ending with ".bin|.bin2"
:areaname The name of an area from the area list (names should be static but can change so if a name does not work anymore look into the area list -> /api/v2/areas)
:id The ID of an area from the area list. IDs will change on every map update so make sure to look them up before you download a map in order to get the newest available map.
:xmin | :xmax Any value between -180 and 180
:ymin | :ymax Any value between -90 and 90