py4sci

Previous topic

map2shape

Next topic

dem_filter

This Page

gdal_density

Created on Fri Dec 7 15:00:29 2012

Usage:

gdal_density -S shapefile -E extent -C cellsize -o outputfile 
             -F outputformat [-r resamplefactor (default = 10)]
             [-b burnvalue (default=1)][-G True|False][-D True|False]
             [-t tempdir][-M]

-G Use gdalwarp instead of pcraster resample (default= False)
-D delete high resolution files after processing (Default=True)
-E [a,b,c,d] following gdal conventions
-t tempdir (to store the high resolution temporary files, default is the current dir
 or the GDAL_DENSITY_TMP environment variable)
-M if specified the burn value is assumed to be given in metres

Converts a shape to a grid. The resulting grid holds (for each cell) the fraction (0-1) covered by the shapefile. The resamplefactor determines the accuracy of the final results. If r is one you get a maps with only zeros and ones (two possibilities). If r is two you get 5 possible fractions (0,0.25,0.5,0.75,1), if r is ten you get a map with 101 possible fractions etc...

requirements:

  • gdal_warp
  • gdal_rasterize
  • pcraster 4.0 + python bindings
gdal_density.detDegreeLen(metres)

in length in metres out length in degree

gdal_density.lattometres(lat)

” Determines the length of one degree lat/long at a given latitude (in meter). Code taken from http:www.nga.mil/MSISiteContent/StaticFiles/Calculators/degree.html Input: map with lattitude values for each cell Returns: length of a cell lat, length of a cell long

gdal_density.makeMultMap(outfile, pcrout, metres, gdal_translate='gdal_translate')

Make a map in metres to multiply with and perform the multiplication