Clipping a DEM in Spatialite

28 views
Skip to first unread message

José Sánchez

unread,
May 17, 2018, 7:31:50 AM5/17/18
to SpatiaLite Users
Hi,

I there any specific function to clip a raster within spatialite based on a pair of corner coordinates and/or based on a rectangle or shapefile and export the raster outside spatialite?

Thanks,

mj10777

unread,
May 17, 2018, 7:47:19 AM5/17/18
to SpatiaLite Users


On Thursday, 17 May 2018 13:31:50 UTC+2, José Sánchez wrote:
Hi,

I there any specific function to clip a raster within spatialite based on a pair of corner coordinates and/or based on a rectangle or shapefile and export the raster outside spatialite?
If it a external raster: no, for this you must use gdalwarp parameters 
-crop_to_cutline : use -cutline and -csql for cutting
-cutline : dame of spatialite-database
-csql a valid sql to retrieve the Polygon to use as cutline

Sample:
-crop_to_cutline -cutline Berlin_Liebenow.maps.gcp.db -csql "SELECT cutline_polygon FROM create_cutline_polygons WHERE ((id_gcp_coverage = (SELECT id_gcp_coverage FROM gcp_coverages WHERE (raster_file LIKE '1867.Berlin_Liebenow_5_Pariser_Platz.6250%'))) AND (cutline_type=77));

As a RasterLite2 image use the export commands.

Mark

Thanks,
Reply all
Reply to author
Forward
0 new messages