Comments (8)
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.
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.
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.
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.
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.
Fixed as of c056a10
from landsat-cogeo-mosaic.
Leaving open until supported from STAC features as well
from landsat-cogeo-mosaic.
A little messy but supported from STAC as of 94a502b
from landsat-cogeo-mosaic.
Related Issues (17)
- Missing tiles on east coast HOT 1
- Missing areas HOT 1
- Script to upload/update dynamodb HOT 2
- Mosaic validation HOT 1
- "Last-ditch" effort to find pathrow
- Add load_index_data function
- Requirements.txt is missing some requirements HOT 1
- landsat-cogeo-mosaic index fails with error HOT 5
- Avoid hitting recursion limit
- sort by percent overlap HOT 5
- Work with any STAC, not just landsat HOT 1
- Provide alternative sorts HOT 1
- Use same-year imagery when possible HOT 2
- Missing data in corners? HOT 2
- Incorrect path-row positions HOT 1
- Compute quadkeys over land HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from landsat-cogeo-mosaic.