{ "cells": [ { "cell_type": "markdown", "id": "8165d33c-97f9-4c13-907b-91be36951c95", "metadata": {}, "source": [ "# Connect to and get data from ArcGIS REST services\n", "O.Kaufmann, 2023." ] }, { "cell_type": "code", "execution_count": 1, "id": "e1651677-3ab3-46e3-a8a2-dd0724af4666", "metadata": {}, "outputs": [], "source": [ "from geometron.plot import basemaps\n", "from geometron.utils.url import url_open_with_retry, http_request, url_request_string\n", "from geometron.utils.str import remove_accents\n", "from geometron.utils.geoservices import arcgis_rest_services_directory, esri_rest_server_request, esri_rest_server_metadata\n", "import urllib\n", "import json\n", "import pandas as pd" ] }, { "cell_type": "code", "execution_count": 2, "id": "d19fd989-41ed-4da9-bad6-e9a26818cc90", "metadata": {}, "outputs": [], "source": [ "#server = 'https://geoservices.wallonie.be/arcgis/rest/services/'\n", "server = 'https://ags.geo.api.vlaanderen.be/arcgis/rest/services/' " ] }, { "cell_type": "markdown", "id": "5f2274ee-9efb-4c75-b368-d24e7011bd21", "metadata": {}, "source": [ "## Retrieve a dataframe describing available services from an ESRI REST server using a keyword" ] }, { "cell_type": "code", "execution_count": 3, "id": "82750fda-c3b9-45ed-a2ec-84a080fdc47d", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "https://ags.geo.api.vlaanderen.be/arcgis/rest/services//vlm/MapServer\n", "https://ags.geo.api.vlaanderen.be/arcgis/rest/services//vlm/MapServer/0\n", "https://ags.geo.api.vlaanderen.be/arcgis/rest/services//vlm/MapServer/1\n", "https://ags.geo.api.vlaanderen.be/arcgis/rest/services//vlm/MapServer/2\n", "The read operation timed out\n", "https://ags.geo.api.vlaanderen.be/arcgis/rest/services//vlm/MapServer/3\n", "https://ags.geo.api.vlaanderen.be/arcgis/rest/services//vlm/MapServer/4\n", "https://ags.geo.api.vlaanderen.be/arcgis/rest/services//vlm/MapServer/5\n", "https://ags.geo.api.vlaanderen.be/arcgis/rest/services//vlm/MapServer/6\n", "https://ags.geo.api.vlaanderen.be/arcgis/rest/services//vlm/MapServer/7\n", "https://ags.geo.api.vlaanderen.be/arcgis/rest/services//vlm/MapServer/8\n", "https://ags.geo.api.vlaanderen.be/arcgis/rest/services//vlm/MapServer/9\n", "https://ags.geo.api.vlaanderen.be/arcgis/rest/services//vlm/MapServer/10\n", "https://ags.geo.api.vlaanderen.be/arcgis/rest/services//vlm/MapServer/11\n", "https://ags.geo.api.vlaanderen.be/arcgis/rest/services//vlm/MapServer/12\n", "https://ags.geo.api.vlaanderen.be/arcgis/rest/services//vlm/MapServer/13\n", "https://ags.geo.api.vlaanderen.be/arcgis/rest/services//vlm/MapServer/14\n", "https://ags.geo.api.vlaanderen.be/arcgis/rest/services//vlm/MapServer/15\n", "https://ags.geo.api.vlaanderen.be/arcgis/rest/services//vlm/MapServer/16\n", "https://ags.geo.api.vlaanderen.be/arcgis/rest/services//vlm/MapServer/17\n", "https://ags.geo.api.vlaanderen.be/arcgis/rest/services//vlm/MapServer/18\n", "https://ags.geo.api.vlaanderen.be/arcgis/rest/services//vlm/MapServer/19\n", "https://ags.geo.api.vlaanderen.be/arcgis/rest/services//vlm/MapServer/20\n", "https://ags.geo.api.vlaanderen.be/arcgis/rest/services//vlm/MapServer/21\n", "https://ags.geo.api.vlaanderen.be/arcgis/rest/services//vlm/MapServer/22\n", "https://ags.geo.api.vlaanderen.be/arcgis/rest/services//vlm/MapServer/23\n", "https://ags.geo.api.vlaanderen.be/arcgis/rest/services//vlm/MapServer/24\n" ] }, { "data": { "text/html": [ "
\n", " | folder | \n", "services | \n", "service_type | \n", "id_layer | \n", "name | \n", "alias | \n", "layer_type | \n", "url | \n", "
---|---|---|---|---|---|---|---|---|
0 | \n", "\n", " | vlm | \n", "MapServer | \n", "0 | \n", "beheergebieden | \n", "beheergebieden | \n", "Group Layer | \n", "https://ags.geo.api.vlaanderen.be/arcgis/rest/... | \n", "
1 | \n", "\n", " | vlm | \n", "MapServer | \n", "1 | \n", "behgebgrasland | \n", "behgebgrasland | \n", "Feature Layer | \n", "https://ags.geo.api.vlaanderen.be/arcgis/rest/... | \n", "
2 | \n", "\n", " | vlm | \n", "MapServer | \n", "2 | \n", "behgebwaterkwal | \n", "behgebwaterkwal | \n", "Feature Layer | \n", "https://ags.geo.api.vlaanderen.be/arcgis/rest/... | \n", "
3 | \n", "\n", " | vlm | \n", "MapServer | \n", "3 | \n", "behgebweidevogel | \n", "behgebweidevogel | \n", "Feature Layer | \n", "https://ags.geo.api.vlaanderen.be/arcgis/rest/... | \n", "
4 | \n", "\n", " | vlm | \n", "MapServer | \n", "4 | \n", "behgebakkervogel | \n", "behgebakkervogel | \n", "Feature Layer | \n", "https://ags.geo.api.vlaanderen.be/arcgis/rest/... | \n", "
5 | \n", "\n", " | vlm | \n", "MapServer | \n", "5 | \n", "behgebnat2000 | \n", "behgebnat2000 | \n", "Feature Layer | \n", "https://ags.geo.api.vlaanderen.be/arcgis/rest/... | \n", "
6 | \n", "\n", " | vlm | \n", "MapServer | \n", "6 | \n", "gebnit | \n", "gebnit | \n", "Feature Layer | \n", "https://ags.geo.api.vlaanderen.be/arcgis/rest/... | \n", "
7 | \n", "\n", " | vlm | \n", "MapServer | \n", "7 | \n", "gebnit19 | \n", "gebnit19 | \n", "Feature Layer | \n", "https://ags.geo.api.vlaanderen.be/arcgis/rest/... | \n", "
8 | \n", "\n", " | vlm | \n", "MapServer | \n", "8 | \n", "gebnit21 | \n", "gebnit21 | \n", "Feature Layer | \n", "https://ags.geo.api.vlaanderen.be/arcgis/rest/... | \n", "
9 | \n", "\n", " | vlm | \n", "MapServer | \n", "9 | \n", "gebnit23 | \n", "gebnit23 | \n", "Feature Layer | \n", "https://ags.geo.api.vlaanderen.be/arcgis/rest/... | \n", "
10 | \n", "\n", " | vlm | \n", "MapServer | \n", "10 | \n", "natuurinrichting | \n", "natuurinrichting | \n", "Group Layer | \n", "https://ags.geo.api.vlaanderen.be/arcgis/rest/... | \n", "
11 | \n", "\n", " | vlm | \n", "MapServer | \n", "11 | \n", "rvvnatinrprj | \n", "rvvnatinrprj | \n", "Feature Layer | \n", "https://ags.geo.api.vlaanderen.be/arcgis/rest/... | \n", "
12 | \n", "\n", " | vlm | \n", "MapServer | \n", "12 | \n", "natinrprj | \n", "natinrprj | \n", "Feature Layer | \n", "https://ags.geo.api.vlaanderen.be/arcgis/rest/... | \n", "
13 | \n", "\n", " | vlm | \n", "MapServer | \n", "13 | \n", "ruilverkaveling | \n", "ruilverkaveling | \n", "Group Layer | \n", "https://ags.geo.api.vlaanderen.be/arcgis/rest/... | \n", "
14 | \n", "\n", " | vlm | \n", "MapServer | \n", "14 | \n", "rvkinderminne | \n", "rvkinderminne | \n", "Feature Layer | \n", "https://ags.geo.api.vlaanderen.be/arcgis/rest/... | \n", "
15 | \n", "\n", " | vlm | \n", "MapServer | \n", "15 | \n", "rvvrvkgiw | \n", "rvvrvkgiw | \n", "Feature Layer | \n", "https://ags.geo.api.vlaanderen.be/arcgis/rest/... | \n", "
16 | \n", "\n", " | vlm | \n", "MapServer | \n", "16 | \n", "rvkgrinfrawerken | \n", "rvkgrinfrawerken | \n", "Feature Layer | \n", "https://ags.geo.api.vlaanderen.be/arcgis/rest/... | \n", "
17 | \n", "\n", " | vlm | \n", "MapServer | \n", "17 | \n", "rvvrvkukw | \n", "rvvrvkukw | \n", "Feature Layer | \n", "https://ags.geo.api.vlaanderen.be/arcgis/rest/... | \n", "
18 | \n", "\n", " | vlm | \n", "MapServer | \n", "18 | \n", "rvkkrachtwet | \n", "rvkkrachtwet | \n", "Feature Layer | \n", "https://ags.geo.api.vlaanderen.be/arcgis/rest/... | \n", "
19 | \n", "\n", " | vlm | \n", "MapServer | \n", "19 | \n", "landinrichting | \n", "landinrichting | \n", "Group Layer | \n", "https://ags.geo.api.vlaanderen.be/arcgis/rest/... | \n", "
20 | \n", "\n", " | vlm | \n", "MapServer | \n", "20 | \n", "rvvlandinrpl | \n", "rvvlandinrpl | \n", "Feature Layer | \n", "https://ags.geo.api.vlaanderen.be/arcgis/rest/... | \n", "
21 | \n", "\n", " | vlm | \n", "MapServer | \n", "21 | \n", "landinrpl | \n", "landinrpl | \n", "Feature Layer | \n", "https://ags.geo.api.vlaanderen.be/arcgis/rest/... | \n", "
22 | \n", "\n", " | vlm | \n", "MapServer | \n", "22 | \n", "vastgestlandinrprj | \n", "vastgestlandinrprj | \n", "Feature Layer | \n", "https://ags.geo.api.vlaanderen.be/arcgis/rest/... | \n", "
23 | \n", "\n", " | vlm | \n", "MapServer | \n", "23 | \n", "landinrinond | \n", "landinrinond | \n", "Feature Layer | \n", "https://ags.geo.api.vlaanderen.be/arcgis/rest/... | \n", "
24 | \n", "\n", " | vlm | \n", "MapServer | \n", "24 | \n", "fyssyst | \n", "fyssyst | \n", "Feature Layer | \n", "https://ags.geo.api.vlaanderen.be/arcgis/rest/... | \n", "