Hello,
we often need to work with data containing geographic coordinates. For example we need
- to transform CRS, e. g. lat/lon (EPSG 4326) to UTM (EPSG 25832)
- to lookup the area corresponding to a point in a polygon shapefile/geopackage.
In the past we tried various solutions. We didn't succeed using GDAL (and maybe geopandas) in Python. pip install gdal doesn't work. With conda the gdal install is easier, but using conda as Python environment for SPSS broke after some time.
We than resorted to use command line tools like ogr2ogr and gdaltransform via host commands or Python subprocess. These are available in OSGeo4W, resp. with an existing QGIS installation.
One workflow I fiddled out as that works pretty fast but seems way too complicated and fragile:
- use ogr2ogr to move a shapefile to a PostGIS server (host command)
- print coordinates from SPSS to a text file (write command)
- use psql and it's \copy command to move the coordinates to PostGIS (host command)
- use ODBC (driver installation needed) to query the spatial relationship (get data /type=odbc command)
Do you have some useful advice for this tasks? Thank you.
------------------------------
Kai Borgolte
------------------------------