Code Monkey home page Code Monkey logo

Comments (7)

vincentsarago avatar vincentsarago commented on June 28, 2024 1

😭 there are 2 issues here:

To fix this we can do something like:

def get_bounds(geom: Dict) -> Tuple[float, float, float, float]:
    """Get Bounds from GeoJSON geometry and handle multi polygon crossing the antimeridian line.

    ref: https://github.com/cogeotiff/rio-tiler-pds/issues/77
    """
    if geom["type"] == "MultiPolygon":
        bounds = [
            featureBounds({"type": "Polygon", "coordinates": poly})
            for poly in geom["coordinates"]
        ]
        minx, miny, maxx, maxy = zip(*bounds)
        return [max(minx), min(miny), min(maxx), max(maxy)]

    return featureBounds(geom)

Which will return [175.38292995222957, 61.06949078480844, -179.34123633603335, 62.88226850489882] for the S1A_IW_GRDH_1SDV_20230726T183302_20230726T183327_049598_05F6CA_31E7 dataset (instead of [-180.0, 61.06949078480844, 180.0, 62.88226850489882])

  • There is another issue within rasterio/gdal for the Sentinel-1 dataset. The COG are not directly georeferenced but uses internal GCPS. In rio-tiler we use those GCPS to virtually warp the data to geographic projection and then read tile. Sadly for GCPS dataset crossing the dateline there is an issue (see: rasterio/rasterio#2892).

from rio-tiler-pds.

jonaraphael avatar jonaraphael commented on June 28, 2024

Seems like no one has taken any action on your rasterio bug?
Are there any workarounds that can be implemented in rio-tiler-pds while waiting for that to be resolved, or have you already implemented something?

from rio-tiler-pds.

vincentsarago avatar vincentsarago commented on June 28, 2024

Sadly even if we fix the bounds in rio-tiler-crs (as mentioned in the previous comment) there will still be the issue in rasterio/gdal

from rio-tiler-pds.

vincentsarago avatar vincentsarago commented on June 28, 2024

@jonaraphael I just publish a new version with a fix for #78 and the multi-polygon bug BUT this won't fix the underlying issue in rasterio: rasterio/rasterio#2892)

from rio-tiler-pds.

jonaraphael avatar jonaraphael commented on June 28, 2024

Thank you for the progress!

from rio-tiler-pds.

mdsumner avatar mdsumner commented on June 28, 2024

is there anyway you can provide the file in rasterio 2892 without it being on user-pays S3? I'd like to explore this.

from rio-tiler-pds.

jonaraphael avatar jonaraphael commented on June 28, 2024

Hi @mdsumner!
Sorry, I was on vacation the past two weeks.
You can download the TIFF here.

from rio-tiler-pds.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.