Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Faster skipping of empty imagery tiles #29

Open
pkerins opened this issue Sep 4, 2019 · 1 comment
Open

Faster skipping of empty imagery tiles #29

pkerins opened this issue Sep 4, 2019 · 1 comment
Assignees
Labels
refactoring reworking existing functionality for speed, stability, etc

Comments

@pkerins
Copy link
Contributor

pkerins commented Sep 4, 2019

Sometimes when mapping imagery, certain tiles will not contain any actual imagery. Right now, at least during on-the-fly mapping, the system will use dl.raster.ndarray to pull in the image tile, then test the alpha channel for blankness before proceeding with actual mapping (see util_mapping.map_tile). This means lots of unnecessary calls that slow down the overall mapping process. Instead, we could (theoretically) use the geospatial extent of the dl_tile object and the scene itself to do a very quick overlap check, prior to making any raster calls. This would very substantially speed up automated mapping.

@pkerins pkerins added the refactoring reworking existing functionality for speed, stability, etc label Sep 4, 2019
@pkerins
Copy link
Contributor Author

pkerins commented Oct 4, 2019

@eptrszkwcz, you have seemingly implemented something analogous to this for the tree canopy project.

You can see the original issue in the codebase here. As mentioned, the code pulls the actual imagery in and then inspects to see if it is empty, and then concludes if this is the case.

What we would actually want to do is compare the geometry of the tile with the geometry of the relevant scene, and only make a call for actual imagery retrieval if the two coincide. One possibility for accomplishing this would be an optional argument in map_tile for specifying scene geometry. The DL tile, which includes its geometry, is already available.

The final step would be incorporating this into map_scenes_simple, which currently is the only function utilizing map_tile. As it loops through scenes (ie scene_ids), you could do a metadata call to DL, get the shape of the scene, and then pass that shape into each call of map_tile as a keyword argument.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring reworking existing functionality for speed, stability, etc
Projects
None yet
Development

No branches or pull requests

2 participants