The protocol buffer interface in semantictileapi.proto
is used by the Unity
SDK to retrieve feature and terrain tile resources. A replacement service
should implement this API. An example Python server is included to demonstrate
how parameters are passed by the SDK, and how the response should be formed for
compatibility with the SDK.
The archive contains the following files:
semantictileapi.proto
is a protocol buffer definition used by the Unity SDK to retrieve feature and terrain tile resources.server.py
is an example server that demonstrates protocol buffer serialization and serving that is compatible with the SDK.BUILD.bazel
andWORKSPACE.bazel
together comprise a Bazel project that you can use to generate the protocol buffer bindings for Python. See https://bazel.build/ for more information about how to install and use Bazel.example_tiles.py
shows some examples of how to createFeatureTiles
andTerrainTiles
using python.
How to run
After installing Bazel, you can simply run the following command to build and start the server:
> bazel run server
If you don't want to install Bazel, you can also build the Python protocol buffer library using Protoc. See Protocol Buffer Basics: Python for information about how to use the protoc tool, although we recommend to use Bazel to build this example.
You can send a request to the running server with cURL:
> curl 'localhost:8000/featuretiles/@120588,78656,17z?alt=proto' --output test_feature
> curl 'localhost:8000/terraintiles/@120588,78656,17z?alt=proto' --output test_terrain
If you want to see a human-readable format, use alt=json
> curl 'localhost:8000/featuretiles/@120588,78656,17z?alt=json'
More information about the feature and terrain tile formats can be found in the
comments of semantictileapi.proto
.