clipping a raster data within a polygon

asked 2019-11-09 10:27:21 -0600

Ahmet gravatar image

Hi, I am new to opencv. What I would like to know is how I can clip a raster data within a polygon (not rectangle) using c++. I.e. Dem data within province border.

Regards

edit retag flag offensive close merge delete

Comments

explain "clip" , please.

berak gravatar imageberak ( 2019-11-09 10:28:15 -0600 )edit

Cropping out ( or extracting) spatial raster data within a polygon.

Ahmet gravatar imageAhmet ( 2019-11-09 10:38:10 -0600 )edit

you can't. "cropping" means - cut out a rectangle along the axes of the image dimensions.

so -- what do you want / need ? (please try to refine it)

berak gravatar imageberak ( 2019-11-09 10:55:22 -0600 )edit

think of it -- how would "clipwith a raster data within a polygon" result in an "image" ?

also: "clipping" usually refers to retaining a pixels value to some e.g. [0..255] range, certainly not , what you wanted.

berak gravatar imageberak ( 2019-11-09 11:01:26 -0600 )edit

How about, masking data out of polygon? Or giving null values to data corresponding to out of polygon ?

Ahmet gravatar imageAhmet ( 2019-11-09 11:06:40 -0600 )edit