DEV Community

Taylor Higgins
Taylor Higgins

Posted on • Updated on

Making an ETL Pipeline for geospatial data to postgres/postgis database

Extract - First I gather the data from USGS's earth explorer for elevation data, global extreme sea level prediction data from the European commission, and the hydrobasin data from the hydroshed project and finally the country boundries data from natural earth data.

Load - Then I load each dataset into the relational database. Which was built using docker image of postgis extension of postgres. And then connected to qGis for the team to access. This amazing tutorial was super helpful here.

Transform - Finally I clip, vectorize, deduplicate and merge the datasets with sql spatial queries, qGis and geopandas so that all data is consistent.

the steps here involve resampling the rasters to be a less fine grain, then clipping the data to remove ocean pixels, and then, vectorizing the rasters with zonal statistics, removing irrelevant attributes from the hydrobasin dataset and merging the hydrobasin and sealevel rise prediction datasets by a spatial join, and then merging that data to the vectorized raster by the common hydrobasin column. Finally basic subtraction is applied to find the areas of elevation data that are at risk of sea level rise.

Further mapping is then done in qGis to understand the crop yield loss and other economic factors.

Transform steps - Processing:

-All steps leading up to analysis and visualisation steps, so the output is the file with all hexagons and elevation zonal stats data, the pivoted elsr data on hydrobasin, and finally the clipped shapefile in 3035 epsg for italy with the hexagons and geometry.

okay so we got the dem data from usgs script on a bounding box for italy i believe, then merging it into a tif file then in qgis clipping it with the italy boundary and resampling it to be less fine resolution.

the elsr point data we clipped also with the boudnary of italy in qgis

watersheds came from hydrobasins and was also clipped by the italy border in qgis

Top comments (0)