Coder Social home page Coder Social logo

Comments (8)

kylebarron avatar kylebarron commented on June 26, 2024

You might want to take (an optional, user-defined?) buffer on the pathrow boundaries. For example pathrow boundaries vary a little (#8 (comment)).

So maybe reduce the area to 99% of its size? The hard thing would be making it smaller in a way that conserves its shape. Find the geometry's centroid and then bring each coordinate 1% closer to the centroid?

Happily, it looks like shapely has built-in support for this :) (https://shapely.readthedocs.io/en/stable/manual.html#shapely.affinity.scale)
So maybe try:

shapely.affinity.scale(geom, xfact=0.99, yfact=0.99, zfact=1.0, origin='centroid')

from landsat-cogeo-mosaic.

kylebarron avatar kylebarron commented on June 26, 2024

Use existing code to generate from DB. but then keep geometry data of each path row and optimize when exporting mosaic

from landsat-cogeo-mosaic.

kylebarron avatar kylebarron commented on June 26, 2024

I think a better way is to first generate an optimized pathrow-quadkey index, a mapping from pathrows to quadkeys.

You have all the geometries of both the path-rows and the zoom-8 tiles ahead of time, so first make this optimized index. (Also allows you to explore it visually ahead of time to make sure there are no gaps).

Then when creating a new mosaic from the sqlite db locally, you don't need to do "for pathrow in all pathrows". You just loop over the pathrows in the index and then only query the db for those in particular.

When creating a custom mosaic on the fly in lambda, do an inner join between the pathrows returned by sat api and the pathrows in this optimized index. That way creating a custom mosaic on the fly should be fast, because you don't have to do lots of geometry checking. But also created mosaics are optimized.

from landsat-cogeo-mosaic.

kylebarron avatar kylebarron commented on June 26, 2024

Note: pr2coords.json looks to be exactly the same as the WRS geometry shapefile from https://www.usgs.gov/land-resources/nli/landsat/landsat-shapefiles-and-kml-files

from landsat-cogeo-mosaic.

kylebarron avatar kylebarron commented on June 26, 2024

This is now supported in the index cli, which creates a pathrow-quadkey index file, and create-from-db which utilizes it.

from landsat-cogeo-mosaic.

kylebarron avatar kylebarron commented on June 26, 2024

Fixed as of c056a10

from landsat-cogeo-mosaic.

kylebarron avatar kylebarron commented on June 26, 2024

Leaving open until supported from STAC features as well

from landsat-cogeo-mosaic.

kylebarron avatar kylebarron commented on June 26, 2024

A little messy but supported from STAC as of 94a502b

from landsat-cogeo-mosaic.

Related Issues (17)

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.