ArcGIS API Python Script, Data Extraction to PostgreSQL

Job ID: 38984329

Budget: $15 – $25 USD

Project Title:
Python Script to Query ArcGIS REST API and Save Layers (including Parcels) Data in PostgreSQL

Description:
I need a Python script to interact with the ArcGIS REST API of the provided service. The script should:

Retrieve and list all available layers and tables from the service.
Specifically query the DLSPortalMain.dbo.Property (14) table to extract parcel data, including geometries and attributes.
Save the retrieved data into a PostgreSQL database with a properly defined schema.

API Reference:
https://eservices.dls.moi.gov.cy/arcgis/rest/services/National/General_Search/MapServer

or

https://eservices.dls.moi.gov.cy/arcgis/rest/services/National/CadastralMap_EN_KML_Parcel_EXP/MapServer

or

https://eservices.dls.moi.gov.cy/arcgis/rest/services/National/Cadastral_Data_Export_EN/MapServer

Scope of Work:
List Layers and Tables:

Query the provided REST API to retrieve and list all available layers and tables.
Ensure DLSPortalMain.dbo.Property (14) is included in the output.
Query DLSPortalMain.dbo.Property:

Query the DLSPortalMain.dbo.Property (14) table to retrieve:
Parcel geometries (e.g., polygons or points).
All associated attributes for each parcel.
Save Data to PostgreSQL:

Save the data (geometries and attributes) into a PostgreSQL database.
Use PostGIS to store geometries properly.
Ensure the schema includes:
A geometry column for spatial data.
Columns for all parcel attributes.

Error Handling:

Implement error handling for:
Invalid responses from the API.
Connectivity issues with the database or API.
Documentation:

Provide clear instructions on:
Setting up the PostgreSQL database (including PostGIS).
Configuring database connection parameters.
Running the script.
Document Python dependencies (e.g., requests, psycopg2, geoalchemy2).

Deliverables:
Python Script:

A .py file that:
Queries the REST API.
Retrieves and processes data from DLSPortalMain.dbo.Property (14).
Inserts the data into a PostgreSQL database with PostGIS support.
Database Schema:

A PostgreSQL database schema that supports:
Geospatial data (via PostGIS).
Parcel attribute tables.
Documentation:

Step-by-step guide to configure and run the script.
Instructions for setting up PostgreSQL with PostGIS.
Skills Required:
Strong experience in Python programming.
Familiarity with ArcGIS REST API.
Experience with PostgreSQL and PostGIS.
Knowledge of Python libraries like requests, psycopg2, geoalchemy2, and sqlalchemy.
Timeline:
Deliver the script, schema, and documentation within 5 working days from the start date.

Additional Notes:
Ensure the script can handle large datasets efficiently.
Validate the script by testing it with live API responses and inserting sample data into PostgreSQL.
Include comments in the script for better readability and reusability.
Related categories: Python Geospatial PostgreSQL ArcGIS GeoJSON