Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Passing "cutline" as warp_vrt_option

See original GitHub issue


Thanks for the great library, really appreciate it.

I am trying to clip an image with a geojson or wkt geometry as I am tiling.

What would be the best way to do that? I can see there are multiple ways to do this.

  1. Pass an option to main.tile:
(..., warp_vrt_option={'cutline': some_wkt})
  1. Pregenerate a vrt and write it to a temp location and give that path to main.tile.

Is it possible to go with option 1 since it is easier and more straightforward? I could not make option 1 work no matter what I did.

Any thoughts?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

vincentsaragocommented, Feb 10, 2020

🤦‍♂ I should have read the doc better too 😉

The coordinates must be expressed in source pixel/line coordinates.

Glad you succeed 🎉

dorukozturkcommented, Feb 10, 2020

Ok the following worked:

wkt='POLYGON ((4000 4000, 4000 8000, 8000 8000, 8000 4000, 4000 4000))'

so “cutline” requires pixel coordinates. I hope this issue helps other people 😃

Thanks for your help and again thank you for the great library.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use gdal.warp cutline option? - GIS Stack Exchange
The simplest solution I've been able to come up with makes use gdal.Warp in combination with OGR SQL. I've been tackling some days...
Read more >
About Performing the Warp Operation - PTC Support
Setting Up Configuration Options · Setting Up the Cabling Environment · Workflow to Manually Designate Components and Route Cables.
Read more >
Cut-line steering methods for forming a mosaic image of a ...
A method for determining preferred routes for steering mosaic cut line to ... and one that warps the image to fit a rectilinear...
Read more >
CS5670 Project 3 -- Autostitch - Cornell Computer Science
You will be creating two ways to stitch a panorama: using translations (where you'll need to pre-spherically-warp the input images) and homographies, ...
Read more >
Raster — Descartes Labs public documentation
The cutline_all_touched controls how source image pixels are mapped into the output pixels. Specifically it controls the GDAL CUTLINE_ALL_TOUCHED warp option.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found