I want to extract open data map services to gdb.
Here is the link of the open data map services i want to extract: https://egisp.dfo-mpo.gc.ca/arcgis/rest/services/open_data_donnees_ouvertes
Attention! Each one may have multiples layers and sublayers and i need all of the data
I am a real begginer with python but my best would be to write a script to help me do it.
Here is what i have in mind:
- Get all URLs from base site: https://egisp.dfo-mpo.gc.ca/arcgis/rest/services/open_data_donnees_ouvertes?f=pjson
- For each url in urls, get the mapserver json (ex: https://egisp.dfo-mpo.gc.ca/arcgis/rest/services/open_data_donnees_ouvertes/4rst_nafo_fishing_areas_...)
- From that MapServer json file, get the "layers" (but also sublayers is applicable)
- For each layer id, get the geojson file (ex: https://egisp.dfo-mpo.gc.ca/arcgis/rest/services/open_data_donnees_ouvertes/4rst_nafo_fishing_areas_...)
- Download and save the geojson as "{{MapServerName}}.geojson"
- Run the ArcGis "JSON vers entites" tool
Would any of you have already tried to write something like that?
Can someone help me programming this kind of script?
Thanks!