Adapters to help to deal on a high level with the APIs. Provides easy method, preprocessing steps, range value checking, mapping layers to zoom values and such, exception handling. Quoting from the DocString of vector_tiles.py,
"""Adapter model for dealing with the VectorTiles API, through the DRY principle. The
VectorTilesAdapter class can be instantiated in the controller modules, providing an
abstraction layer that uses the Client class, endpoints provided by the APIv4 under
`/config/api/vector_tiles.py`.
It performs parsing, handling of layers, properties, and fields to make it easier to
write higher-level logic for extracting information, and lets developers to focus only
on writing the high-level business logic without having to repeat the process of parsing
and using libraries such as `mercantile`, 'vt2geojson' and others, caring only about inputs/outputs
Usage::
>>> VectorTilesAdapter().fetch_layer(layer="image", zoom=14, longitude=longitude,
latitude=latitude,
)
>>> VectorTilesAdapter().fetch_layer(layer="sequence", zoom=10, longitude=longitude,
latitude=latitude,
)
>>> VectorTilesAdapter().fetch_layer(layer="overview", zoom=3, longitude=longitude,
latitude=latitude,
)
"""
This is for making future work easier by focusing only on the inputs, and the outputs. The vector_tiles.py and entities.py, will depend on client, making use of the correct endpoints as dictated by layers and such.
In the 3rd commit, I've added an example of how it can be used with the 2nd requirement easily to remove lower-level logic.
Feedback required over,
A quick pair of :eyes: on the code and the documentation added
Critique of the design and the structure. Is this useful everywhere? Is there something we can add more?
It should close #13 on merge.
Complete functionality blocked by the waiting-on-merge-of #38
Adapters to help to deal on a high level with the APIs. Provides easy method, preprocessing steps, range value checking, mapping layers to zoom values and such, exception handling. Quoting from the DocString of
vector_tiles.py
,This is for making future work easier by focusing only on the inputs, and the outputs. The
vector_tiles.py
andentities.py
, will depend onclient
, making use of the correct endpoints as dictated by layers and such.In the 3rd commit, I've added an example of how it can be used with the 2nd requirement easily to remove lower-level logic.
Feedback required over,
It should close #13 on merge.
Complete functionality blocked by the waiting-on-merge-of #38