Package: skytek-arcgis-integration
Skytek ArcGis IntegrationPrerequisitesInstall package:pipinstallskytek-arcgis-integrationAdd to installed apps in Django configuration:INSTALLED_APPS+=["rest_framework","skytek_arcgis_integration",]Note: you need to addrest_frameworkif you don't already have it.Usage: ad-hoc without configurationThis 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 configuredThis 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:fromgeneric_map_api.routersimportMapApiRouterfromskytek_arcgis_integration.viewsimportarcgis_view_factoryfires_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 hereurlpatterns+=router.urlsNote: For raster map endpoints (url ends with/MapServer) usearcgis_raster_view_factoryfunction instead:fromskytek_arcgis_integration.viewsimportarcgis_raster_view_factorypopulation_view=arcgis_raster_view_factory("https://ciesin.columbia.edu/arcgis/rest/services/ciesin/popgrid_counts/MapServer/")Usage: generated integration with storageThis 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.pygenerate_arcgis_integrationand 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 yourINSTALLED_APPS, ie.:INSTALLED_APPS+=["rest_framework","skytek_arcgis_integration","arcgis.fh_perimeters",]Run migrations, ie.:./managemakemigrationsarcgis.fh_perimeters
./managemigrateAnd include urls in your configuration, ie.:urlpatterns=[...path("fh_perimeters/",include("arcgis.fh_perimeters.urls")),]Appendix: Interesting data sourcesFeature layersWild land fire perimeters:https://services3.arcgis.com/T4QMspbfLg3qTGWY/ArcGIS/rest/services/Current_WildlandFire_Perimeters/FeatureServer/0/Water flow gauges:https://services9.arcgis.com/RHVPKKiFTONKtxq3/ArcGIS/rest/services/Live_Stream_Gauges_v1/FeatureServer/0/USA Flood hazard areas:https://services.arcgis.com/P3ePLMYs2RVChkJx/ArcGIS/rest/services/USA_Flood_Hazard_Reduced_Set_gdb/FeatureServer/0/Raster mapsWorld population density:https://ciesin.columbia.edu/arcgis/rest/services/ciesin/popgrid_counts/MapServer/NOAA Warnings:https://nowcoast.noaa.gov/arcgis/rest/services/nowcoast/wwa_meteoceanhydro_longduration_hazards_time/MapServer/