[gdal-dev] extract information from polygon shapefile based on raster grid?

Chao YUE chaoyuejoy at gmail.com
Wed Mar 27 13:52:24 PDT 2013


Dear all,

I am using the python binding of GDAL for reading polygon shapefiles.

I have a polygon shapefile which contains the fire polygon and burned area,
with typical fires burning on 10-100ha.
my model simulation result is based on 0.5degree X 0.5degree. So I need to
extract from this shapefile on each gridcell
of the 0.5d X 0.5 grid the information about like number of fires and mean
fire size etc.

The approach I am thinking currently is to calculate the center of each of
fire polygon, and check which 0.5d X 0.5d gridcell
it falls in, then build a huge dictionary with key as the numpy index of
the 0.5dX0.5d array, with the dictionary values as
the list(or array or pandas dataframe) which include the information of all
the polygons falling within the the same grid cell.

I don't know if there is a better approach than this? I appreciate any
comments.

best regards,

Chao

-- 
***********************************************************************************
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF Sur YVETTE Cedex
Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16
************************************************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20130327/b6ce767b/attachment.html>


More information about the gdal-dev mailing list