All Questions
101
questions
0
votes
0
answers
26
views
How to clip a hole with ogr2ogr? [duplicate]
ogr2ogr has a rich set of clip options, e.g.,
-clipsrc [<xmin> <ymin> <xmax> <ymax>]|
WKT|<datasource>|spat_extent
But how can I clip the same sized hole instead?
2
votes
1
answer
62
views
Specify layer when using a geopackage in ogr2ogr
I want to clip a vector-layer by another layer with ogr2ogr as explained here.
I always struggle to find out how to refer to a layer in ogr2ogr for input and output. Does anyone have a quick tip?
1
vote
0
answers
33
views
Clipping WMS with gdal_translate [closed]
I want to clip this WMS https://www.ign.es/wms-inspire/pnoa-ma?SERVICE=WMS& to a specific extent.
I have tried what was suggested in these two posts, but they did not work:
Trying to use ...
4
votes
1
answer
124
views
How to use ogr2ogr's spat_extent keyword to clip a layer of a GPKG file?
I am trying to clip geometries within a GPKG file using a bounding box. I write an L-shaped line to a file:
import geopandas as gpd
import shapely.geometry
l = shapely.geometry.LineString([[0,2],[0,-...
1
vote
0
answers
69
views
How to crop digital elevation .tif file by coordinates with GDAL
I am using SASplanet to download satellite imagery. It has coordinates like in the photo.
I want to crop larger downloaded DEM .tif file of Austria to that same coordinates, so cropped dem file will ...
0
votes
1
answer
184
views
Passing geometry dataset type to gdal.Warp() for a clip operation - order of operations and file type confusion
Trying to wrap my head around the correct order of operations and file type(s) required by gdal.Warp().
I have a valid geometry object created from the shapely object.unary_union.convex_hull method. ...
0
votes
1
answer
27
views
Clipping a raster via mask on runtime before uploading into GeoServer
I have point data which is being interpolated and a raster is generated. The raster is a rectangular grid and I need the raster of Pakistan only. I'm using shapefile of Pakistan to specify the bounds ...
0
votes
1
answer
55
views
Can't use Polygon to Clip Raster
I created a polygon to use to clip a DTM raster (DEMTiff), but the Clip by Mask tool gives an error:
GDAL command:
gdalwarp -overwrite -of GTiff -cutline temp.shp -cl temp -crop_to_cutline "D:\\...
0
votes
2
answers
389
views
Clipping with Python gdal warp gives no output
I clipped a TIFF file using gdal warp, but it is not giving out any output clipped raster. I need help in finding why it does this and how to correct this.
import gdal
ras_in=gdal.Open('C:/Users/Lake....
0
votes
1
answer
2k
views
Using gdal warp to clip raster
I am trying to clip a raster data with GDAL warp. I want data values of raster within the buffer.
import rasterio as rio
import shapely as shp
import geopandas as gp
import numpy as np
raster=rio....
1
vote
0
answers
381
views
How to clip a raster with polygon with no "NoData" pixel outside of polygon
I have a polygon with this shape:
The polygon is diagonal.
And I have a raster that covers all of pixels in the minimum bounding rectangle (MBR) of the polygon.
I used QGIS tool "Clip Raster by ...
2
votes
2
answers
343
views
Clipping raster image using coordinates from CSV file with Python
I am trying to clip a raster image into a small image using coordinates in a CSV file. In the CSV file, I have minx,maxx,miny,maxy as the coordinates which makes the bounding box and clips the images.
...
1
vote
1
answer
431
views
Inconsistent results between gdalWarp (with cutline) and rasterio.mask
Cropping with GDAL cutline vs Rasterio.mask with crop=True results in arrays with different sizes (by one row). I've tested the different Rasterio options but no luck. I'm hoping to match the GDAL ...
4
votes
1
answer
163
views
Gdalwarp clip with negative buffer
Is there any simple way to change this command:
gdalwarp -tr 10 10 -cutline "shape.shp" -crop_to_cutline -of GTiff "S1A_IW_GRDH_1SDV_20200719T161950_20200719T162015_033526_03E28C_C720....
1
vote
1
answer
434
views
Cropping with GDAL python outputs a black section in the image
I am trying to crop an image using GDAL python.
I have tried using both gdal.Warp and gdal.Translate, and both keep bringing the same result.
I have an image that I have orthorectified using gdal.Warp ...