opendatacube / odc-geo

GeoBox and geometry utilities extracted from datacube-core
https://odc-geo.readthedocs.io/en/latest/
Apache License 2.0
83 stars 15 forks source link

Track CRS info in BoundingBox and changes to GeoBox constructors #38

Closed Kirill888 closed 2 years ago

Kirill888 commented 2 years ago
  1. BoundingBox was an odd one out without CRS info attached, now it has that

    • This enables other conveniences, two way conversion polygon<->bbox
  2. Changes to GeoBox.from_bbox

    • Can get CRS info directly from bounding box now
    • Replace confusing "align" that is pretty hard to explain with "anchor"

Essentially if you take 0,0 in the real world, bring it to pixel space and locate pixel that contains it, then you want location within that pixel to be a certain point in [0, 1), [0, 1), so 0,0 is edge aligned, same as align=(0,0) used to be, and to get center aligned pixel you pick (0.5, 0.5). Also you can just not align at all, in which case resulted geobox will start at left,top and might go a little bit over right, bottom.

Also adds some more convenience methods to bounding box and geobox.

Closes #25

codecov[bot] commented 2 years ago

Codecov Report

Merging #38 (8094832) into develop (de7f414) will increase coverage by 0.07%. The diff coverage is 100.00%.

@@             Coverage Diff             @@
##           develop      #38      +/-   ##
===========================================
+ Coverage    97.91%   97.99%   +0.07%     
===========================================
  Files           19       19              
  Lines         2595     2690      +95     
===========================================
+ Hits          2541     2636      +95     
  Misses          54       54              
Impacted Files Coverage Δ
odc/geo/geobox.py 100.00% <100.00%> (ø)
odc/geo/geom.py 100.00% <100.00%> (ø)
odc/geo/gridspec.py 100.00% <100.00%> (ø)
odc/geo/math.py 100.00% <100.00%> (ø)
odc/geo/overlap.py 100.00% <100.00%> (ø)
odc/geo/roi.py 100.00% <100.00%> (ø)
odc/geo/types.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update de7f414...8094832. Read the comment docs.

github-actions[bot] commented 2 years ago

🚀 Deployed on https://6262900412583e00ad0130ac--odc-geo-docs.netlify.app

github-actions[bot] commented 2 years ago

🚀 Deployed on https://626297af0ae2f21146f34ed5--odc-geo-docs.netlify.app

github-actions[bot] commented 2 years ago

🚀 Deployed on https://62629a32d23b5d15c4604a8a--odc-geo-docs.netlify.app