AnsweredAssumed Answered

Extracting data from a public web layer

Question asked by thegrave2000 on Feb 8, 2019
Latest reply on Feb 11, 2019 by thegrave2000



Not sure if it's the right place to ask this question but here it is. There is an open-access GIS that hosts some data I'm interested in:


For some reason English and Bulgarian version have different layer structure but anyways.


I'm fairly new to ArcGIS (and GIS in general) and it's probably an overkill for my needs at this point so I'd like to start with something simple - extract data from "Protected areas in Bulgaria" and "Protected zones Natura 2000" sublayers and have each sublayer in a separate file - preferably KMZ or GPX. I'm aware some metadata will be lost but I don't care about it at this point. Not sure how much will be lost when going to KMZ but for GPX polygons will have to be converted to tracks which is fine for me (as long as I can identify the original object name from the track name). Accuracy is of little importance as it's good enough to know where object boundaries roughly lie on the map. Also, I'm trying to automate this extraction in a Linux shell script.


Couple of things I tried:


1) Retrieving (questionably) all objects within a layer via the rest API:


wget -O - "резерват&layers=0


However, two issues with this approach:


  • searchText is mandatory. While I expect certain words to be present in every layer it's not a foolproof solution.
  • I don't understand the result that I get. First object for example:
{"results":[{"layerId":0,"layerName":"Резервати","displayFieldName":"Name_ENG","foundFieldName":"Type_Name_","value":"Резерват Вълчи дол","attributes":{"FID":"0","Shape":"Polygon","Name_ENG":"Valchi Dol","SITE_CODE":"176839","DESIG_ABBR":"BG01","area":"767","Name_BG":"Вълчи дол","FID_1":"0","Type_Name_":"Резерват Вълчи дол","Purpose_BG":"Целта е да опази единствената в България колония на белоглави лешояди, както и местообитания на други редки и застрашени видове птици.","NAME_BG_1":" ","LINK":" ","NAME_BG_12":" ","LINK_1":" "},"geometryType":"esriGeometryPolygon","geometry":{"rings":[[[2848916.5844476218,5099207.6745737931],[2848891.1791850836,5099275.1015510419],[2848841.0894904374,5099379.3485733839],[2848795.297296484,5099446.2420776887]...

Comma-separated values must be the GPS coordinates of the polygon points but they are in a coordinate system that means nothing to me. If I get those in WGS-84 I might be able to create a GPX file from the output and live with the limitation of this method. Fetching the data via REST API is my number one target as it's easy to process it on CLI.


2) Importing the web layer to ArcGIS Online and exporting the data in KMZ. Doesn't happen due to lack of granted privileges on the server side I guess.


3) Trying the Rest API Python package created by Caleb Mackey but hit a few brickwalls. Python is not in my good skills list unfortunately. I'm on Ubuntu 18.04 which has limited support for Python 2 as far as I'm aware so this might be a problem too.


4) Not tested yet - fetching data in a desktop product (ArcMap would be the correct one I guess) and trying to extract it there. Still waiting for my license. This might be useful if I ever get skilled enough to consolidate all my data in an ArcGIS software and make it public it via a web GIS one day.


Anywhere, my theory is - if a browser can fetch and visualize some data there must be a way to extract it and make use of it.


Any help appreciated.