skytek-arcgis-integration - expose ArcGIS data for Skytek's frontends
Project description
Skytek ArcGis Integration
Prerequisites
Install package:
pip install skytek-arcgis-integration
Add to installed apps in Django configuration:
INSTALLED_APPS += [
"rest_framework",
"skytek_arcgis_integration",
]
Note: you need to add rest_framework
if you don't already have it.
Usage: ad-hoc without configuration
This is the fastest and easiest way of running the integration. Data source url is provided by the user in layer settings. It should be used in proof of concept projects only.
To use this integration simply include urls somewhere in your url config:
urlpatterns = [
...
path("ad-hoc-arcgis/", include("skytek_arcgis_integration.urls")),
]
Usage: ad-hoc with layer configured
This method allows you to set up data source url on the backed.
To use this integration you need to use provided factory to generate view, configure a router and append urls to your configurations:
from generic_map_api.routers import MapApiRouter
from skytek_arcgis_integration.views import arcgis_view_factory
fires_view = arcgis_view_factory("https://services3.arcgis.com/T4QMspbfLg3qTGWY/ArcGIS/rest/services/Current_WildlandFire_Perimeters/FeatureServer/0/")
router = MapApiRouter()
router.register("arc-gis-fires", fires_view, basename="arc-gis-fires")
# existing urlpatterns initialization goes here
urlpatterns += router.urls
Usage: generated integration with storage
This method generates a separate, ready to use django application. It contains api client, celery tasks, storage models, view with serializer and django admin page.
Run generation command in your shell:
./manage.py generate_arcgis_integration
and provide configuration details. Only layer base url is required, you can use defaults for the rest.
$ ./manage.py generate_arcgis_integration
Enter base layer_url: https://services3.arcgis.com/T4QMspbfLg3qTGWY/ArcGIS/rest/services/Current_WildlandFire_Perimeters/FeatureServer/0
Enter full module path [arcgis.fh_perimeters]:
Enter model name [FhPerimeter]:
Enter celery app path [react_events.celery.app]:
Now add newly generated module to your INSTALLED_APPS
, ie.:
INSTALLED_APPS += [
"rest_framework",
"skytek_arcgis_integration",
"arcgis.fh_perimeters",
]
Run migrations, ie.:
./manage makemigrations arcgis.fh_perimeters
./manage migrate
And include urls in your configuration, ie.:
urlpatterns = [
...
path("fh_perimeters/", include("arcgis.fh_perimeters.urls")),
]
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for skytek-arcgis-integration-0.1.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14ba70c7dc09319a7ee77ad8eb64b6ab5da3ba22d2e409ff78aa761349cc79dd |
|
MD5 | 5c3cf4b09451424a8844eceacc2946ef |
|
BLAKE2b-256 | 780b79c8014c6c5bcf1ee3f7ecd7af367e67eedd4af83252b6f09aea5480eed9 |
Hashes for skytek_arcgis_integration-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7206f3329316187b665b78f6eb5c7fcf303dcd973820de391956ea94952efa1c |
|
MD5 | dedb988596e998876966cd9fa858950d |
|
BLAKE2b-256 | 6f6ab7f6495f4e42687817abfacc4534532ae72acb13b49aff9483d227a507f6 |