[gdal-dev] RE clip intersected

Steve.Toutant at inspq.qc.ca Steve.Toutant at inspq.qc.ca
Fri Jul 17 14:59:39 EDT 2009


I finally got gdal_polygonize.py and tried it and generate a shapefile. I 
might not use it as a solution for what I described below but I would like 
to use it for other purpose.
My understanding is this function merge contiguous cells with the same 
pixel value.

Can I use this function and specify a range of value?
Example: merge contiguous cells having a value > 16 and < 19

thanks
Steve


Steve Toutant, M. Sc.
Analyste en géomatique
Secteur environnement
Direction des risques biologiques, environnementaux et occupationnels
Institut national de santé publique du Québec
945, avenue Wolfe
Québec, Qc G1V 5B3 
Tél.: (418) 650-5115 #5281
Fax.: (418) 654-3144
steve.toutant at inspq.qc.ca
http://www.inspq.qc.ca
 




Frank Warmerdam <warmerdam at pobox.com>@lists.osgeo.org 
Envoyé par : gdal-dev-bounces at lists.osgeo.org
17/07/2009 01:24 PM

A
Steve.Toutant at inspq.qc.ca
cc
gdal-dev at lists.osgeo.org
Objet
Re: [gdal-dev] RE clip intersected








Steve.Toutant at inspq.qc.ca wrote:
> 
> I might try this..is it the good way to do what I need?
> 
> 1- Use gdal_polygonize.py to create a boundary (excluding pixels with no 

> value) of each image and save the boundary as a .shp
> 2- Somehow find the intersected region of the 2 polygons (boundaries) 
> created above and save the result to .shp
> 3- Use gdal_rasterize on one of the original image  to burn a nodata 
> value based on the polygon representing the intersection area
> 
> I didn't try yet because I don't have gdal_polygonize.py
> My installation is from MS4W and this script is not there. I just 
> install GDAL with OSGEO4w and it seems that this script doesn't exist.
> 
> If the method above is valid,
> - how can I create a boundary excluding pixels with nodata?
> - And, of course, where can I get  gdal_polygonize.py

Steve,

I would be tempted to do this process in raster space.  Perhaps by warping
both images into different bands of a mosaic file to get everything 
overlaying
and then using some sort of raster modelling (perhaps via numpy in a 
python
script) to zero out the one image where the other is set.

I think the vector mask approach would be difficult, in part because the 
mask
produced would be very fine grained.  Depending on your need for precision 
you
could just hand digitize a vector mask suitable to wipe out the 
overlapping
area.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, 
warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

_______________________________________________
gdal-dev mailing list
gdal-dev at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20090717/028462b5/attachment.html


More information about the gdal-dev mailing list