Difference between revisions of "Mapserver rewrite"

From Navit's Wiki
Jump to: navigation, search
 
Line 30: Line 30:
 
|-
 
|-
 
|/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 37: Line 35:
 
|/api/v2/download/area/id/:id/:format||||
 
|/api/v2/download/area/id/:id/:format||||
 
|-
 
|-
|/api/v2/download/area/name/:area||||
+
|/api/v2/download/area/name/:areaname||||
 
|-
 
|-
|/api/v2/download/area/name/:area/:format||||
+
|/api/v2/download/area/name/:areaname/:format||||
 
|-
 
|-
 
|||||
 
|||||
Line 47: Line 45:
 
|/api/v2/filesize/bbox/:xmin/:xmax/:ymin/:ymax/:format||||/api/v2/filesize/bbox/-180/180/-90/90/planet.bin
 
|/api/v2/filesize/bbox/:xmin/:xmax/:ymin/:ymax/:format||||/api/v2/filesize/bbox/-180/180/-90/90/planet.bin
 
|-
 
|-
|/api/v2/filesize/area/:area||Outputs the filesize of the downloadable area given by its area name. Defaults to json||
+
|/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/:area/:responseformat||Outputs the filesize of the downloadable area given by its area name in the supplied response format||
+
|/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||Outputs the filesize of the downloadable area given by its id. Defaults to json||
+
|/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/:responseformat||Outputs the filesize of the downloadable area given by its id in the supplied response 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 65: Line 63:
 
|:format||bin | bin2 | a UTF-8 filename ending with ".bin|.bin2"
 
|:format||bin | bin2 | a UTF-8 filename ending with ".bin|.bin2"
 
|-
 
|-
|:area||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)
+
|: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.
 
|: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.

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