Compare commits

...

2 Commits

Author SHA1 Message Date
Sam 4cf874ca77 Merge branch 'master' of git.bitlab21.com:sam/baseddata.io 2024-08-14 11:48:09 +01:00
Sam 6ec45a5dd6 Modify content 2024-08-14 11:47:45 +01:00
1 changed files with 3 additions and 3 deletions

View File

@ -51,7 +51,7 @@ Next we can run the following command to download the rasters. This will take so
aws s3 cp s3://raster/SRTM_GL1/ . --recursive --endpoint-url https://opentopography.s3.sdsc.edu --no-sign-request
{{</ highlight >}}
If you'd prefer to download specific rasters or rasters for a region instead, you can checkout this [website](https://dwtkns.com/srtm30m/).
If you'd prefer to download specific rasters or rasters for a region instead of downloading them all, you can select regions for download from the OpenTopography [website](https://portal.opentopography.org/raster?opentopoID=OTSRTM.082015.4326.1) using the interactive map.
## Using raster2pgsql to import raster tiles into PostGIS
Now we have the data downloaded on our system, we can import it into our database.
@ -98,9 +98,9 @@ So we have just over 12 million 128x128 tiles in the database.
## Raster Clipping
Now we have global SRTM data loaded in our local database, we can extract any of the tiles for further analysis and access this using any application.
Now we have global SRTM data loaded in our local database, we can extract the tiles we want for further analysis.
Here I'll demonstrate using the following PostGIS commands: `st_clip`, `st_intersects` and `st_union` to create a digital elevation table for singapore and access this from from within QGIS.
Here we'll create a digital elevation raster for Singapore to demonstrate using the following PostGIS commands: `st_clip`, `st_intersects` and `st_union`, then import this into QGIS to style and visualise the results.
I already have countries vector data in my Postgres database that I extracted from OpenStreetMaps. You can download a pg_dump of this [here](/data/countries.sql) to insert into your database. Alternatively, I have a post [here](/blogs/import-osm-countries-data) that explains the process to do this manually.