Skip to main content

All Questions

Tagged with
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?
Dan Jacobson's user avatar
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?
Lenn's user avatar
  • 1,297
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 ...
Isa's user avatar
  • 193
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,-...
zabop's user avatar
  • 2,224
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 ...
Alex J.'s user avatar
  • 119
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. ...
bashity's user avatar
  • 109
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 ...
Hayat Ullah Abid's user avatar
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:\\...
Jeff C's user avatar
  • 1
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....
SVpk's user avatar
  • 1
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....
SVpk's user avatar
  • 1
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 ...
milad's user avatar
  • 729
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. ...
user123's user avatar
  • 195
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 ...
bbuzz31's user avatar
  • 429
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....
Flash Thunder's user avatar
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 ...
haveaniceafterlife's user avatar

15 30 50 per page
1
2 3 4 5
7