OpenDataAnalytics / gaia

Gaia is a geospatial analysis library jointly developed by Kitware and Epidemico.
31 stars 15 forks source link

Raster bbox #112

Closed dorukozturk closed 6 years ago

dorukozturk commented 6 years ago

2 things to note here:

1) Footprint is the boundary with no data areas masked as opposed to boundary box which is the extent of an image. See the comparison below. Red one is the bounding box and green one is the footprint.

bbox_vs_footprint

2) Rasterio relies on raster to have a nodata tag. When gdalinfo is called on the layer like:

gdalinfo some_crazy_raster.tiff

We should see this:

Band 1 Block=387x10 Type=UInt16, ColorInterp=Gray
  Min=5970.000 Max=61100.000 
  Minimum=5970.000, Maximum=61100.000, Mean=8519.507, StdDev=2910.222
  NoData Value=0
  Metadata:
    STATISTICS_MAXIMUM=61100
    STATISTICS_MEAN=8519.5071550568
    STATISTICS_MINIMUM=5970
    STATISTICS_STDDEV=2910.2219569724

Note the NoData Value metadata. That value can be add with gdal_translate if missing. In the following case we are creating an output file with nodata value of -9999 attached.

gdal_translate -a_nodata -9999 input.tiff output.tiff
coveralls commented 6 years ago

Coverage Status

Coverage increased (+0.2%) to 72.222% when pulling f835517cb00306294b44414e76a075bb45629275 on raster-bbox into 73dde64e1e316b7af21aa2be23248a3b572c6106 on master.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+0.5%) to 72.454% when pulling 50b7c0082001413865531300c4ed99e10987d4b1 on raster-bbox into 73dde64e1e316b7af21aa2be23248a3b572c6106 on master.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+0.3%) to 72.325% when pulling 50b7c0082001413865531300c4ed99e10987d4b1 on raster-bbox into 73dde64e1e316b7af21aa2be23248a3b572c6106 on master.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+1.2%) to 73.195% when pulling c5309d8a7850123ea3293a01402fbd3b13a4148b on raster-bbox into 73dde64e1e316b7af21aa2be23248a3b572c6106 on master.

dorukozturk commented 6 years ago

@danlipsa Computing the bounding box from the footprint was a good idea. There was already a function in shapely called "bounds" which was giving the bounding box (see).

I think this is ready for another round of review.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+0.3%) to 73.212% when pulling 1712ee6aa5fc66e6e406939ec57995affd3898cd on raster-bbox into ccd2e5825ac6a4620ce37f53e1f09b03618d80c4 on master.

danlipsa commented 6 years ago

LGTM