-
Notifications
You must be signed in to change notification settings - Fork 1
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
[CIF-165] Write layers directly #42
Conversation
@@ -52,6 +56,37 @@ def groupby(self, zones, layer=None): | |||
""" | |||
return LayerGroupBy(self.aggregate, zones, layer, self.masks) | |||
|
|||
def write(self, bbox, output_path, tile_degrees=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we use MAX_TILE_SIZE
as the default tile_degrees
?
Write the layer to a path. Does not apply masks. | ||
|
||
:param bbox: (min x, min y, max x, max y) | ||
:param output_path: local or s3 path to output to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The output_path
needs to be a folder name if written to multiple files, but needs to be a file name with a suffix if written to one file. We could either add instructions for this in the notebook or update the code to make it consistent.
I created a new brach to test this with the current code on main https://github.com/wri/cities-cif/tree/feature/write_layers_rebase It worked to download data with
This produced 100 files totaling 2.75 GB but failed to combine into a vrt. I got 99 of these messages (Note I first tired with |
What changes were proposed in this PR?
-Add function to write layers directly based on bounding box
-Include option to write out data in smaller tiles, grouped together by a VRT.
How was this patch tested?
Notebook example.
Did this PR include necessary documentation updates?