Indoor data

免费增值
通过 openindooor | 已更新 2ヶ月前 | Mapping
人气

0.2 / 10

延迟

59ms

服务等级

0%

Health Check

N/A

返回全部教程 (1)

How to use our API

Tutorial

Begining

Choose one of our two available endpoints:

  • Get /maps/{map}/{z}/{x}/{y}
  • Get /maps/{map}/{layer}/{z}/{x}/{y}

The first one will return a vector tile with all available data while the second while only return some of the available data. The two depends of the provided map,x,y and z.
In order to choose the best solution, please refer to our documentation, section map, to see the different maps and layers.
Once this is done, you have to configure the right parameters (x,y,z).

This example will work with the first endpoint. The choosen map is: openindoor.
In our example, we want a small vector tile with latitude 47.39014 and longitude 0.69244 at its centre.

First method

Visit our rendering vector tiles website: https://api-mvt.openindoor.io/
The first number after the “#” is the zoom, the second is the latitude and the third is the longitude. Once you have find the palce you want to extract, click on the 4th bottom right corner button. You should see a grid pattern hat corresponds to the cutting of the vector tiles.
Then choose the most appropriate tile (14/8223/5736 for us).

Our final endpoint is therefore: /maps/openindoor/14/8223/5736. The corresponding full url is: https://indoor-data.p.rapidapi.com/maps/openindoor/14/8223/5736 .

Second method

You can use google map for determines latitude and longitude: Google Map example. However the zoom is different, it must be decrease by 1 or 2. It is the same for OpenStreetMap: OpenStreetMap example.

Thanks to the longitude and latitude, we can know the row and column of the corresponding tile. (z is the choosen zoom, here z=14)

x = (longitude_deg + 180.0) / 360.0*(2**z) = 8223.65116
y = (1.0 - asinh(tan(latitude_deg*pi / 180)) / pi) / 2.0*(2**z) =  5736.72399

Where:

  • " ** " -> power
  • " * " -> time
  • " / " -> Classic division
  • tan -> tangent
  • asinh -> arcsinh
  • pi = 3.14159
  • longitude_deg = 0.69244
  • latitude_deg = 47.39014

Depending on the location of the data you want, you may need several vector tiles.
If you do not know exactly where the data is, it is advisable to round down.
Thus x = 8223 and y = 5736.

Our final endpoint is therefore: /maps/openindoor/14/8223/5736. The corresponding full url is: https://indoor-data.p.rapidapi.com/maps/openindoor/14/8223/5736 .