Skip to content

fix image and tile format inconsistency #66

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

Merged
merged 4 commits into from
Apr 17, 2018
Merged

fix image and tile format inconsistency #66

merged 4 commits into from
Apr 17, 2018

Conversation

giswqs
Copy link
Contributor

@giswqs giswqs commented Apr 11, 2018

When a local GeoTIFF or a remote Cloud Optimized GeoTIFF is provided, the image tiles are generated in jpg format. Therefore, the label-maker package command should look for image tiles in jpg format rather than tif format.

When a local GeoTIFF or a remote Cloud Optimized GeoTIFF is provided, the image tiles are generated in jpg format. Therefore, the `label-maker package` should look for image tiles in jpg format rather than tif format.
@giswqs
Copy link
Contributor Author

giswqs commented Apr 11, 2018

@drewbo Thanks a lot for adding support for GeoTIFF reading!! I tested the new version using a local GeoTIFF, everything worked fine except the package command, which was looking for *.tif in the tiles folder. However, the titles were generated using jpg format earlier. Therefore, no tif tiles could be found and the resulting data.npz is empty. I added two lines. Now everything works like a charm! Thanks a lot for such a great tool!

@drewbo
Copy link
Contributor

drewbo commented Apr 11, 2018

Thanks @giswqs we definitely overlooked this. Could you add a test case for this situation to test/integration folder? I can give some assistance setting that up if you need

@giswqs
Copy link
Contributor Author

giswqs commented Apr 12, 2018

@drewbo This is my first-time learning and using unittest. Feel free to discard my changes if it is the not right way. Added files:

What I did:

  • Downloaded a sample GeoTIFF from here and saved it to test/fixtures/integration/geotiff/

  • Run the following three commands. The resulting files are saved to the folder sao_tome under test/fixtures/integration/. Note that I did not upload the sao_tome folder to GitHub, which includes 420 files and 3 sub-folders.
    label-maker download --dest sao_tome --config config.intergration.geotiff_package.json
    label-maker labels --dest sao_tome --config config.intergration.geotiff_package.json
    label-maker images --dest sao_tome --config config.intergration.geotiff_package.json

  • Run unit test
    python -m unittest test/integration/test_geotiff_package.py

  • Result

.
----------------------------------------------------------------------
Ran 1 test in 2.781s

OK

@drewbo
Copy link
Contributor

drewbo commented Apr 16, 2018

@giswqs thanks! This is almost there. Because all our tests run automatically on CircleCI, we need to have the images already present. We already have a very small portion of this tif present in the test/fixtures folder so if you make the bounding box very small, you can run label-maker images and then label-maker package. Instead of running label-maker download and label-maker labels, you can add the labels.npzdirectly (it should be fairly small). Let me know if you need any help with this

@giswqs
Copy link
Contributor Author

giswqs commented Apr 17, 2018

@drewbo Thanks for your guidance! I have changed the bounding box (4 tiles with zoom level 20) and added labels-tif.npz based on the small drone.tif. 'abel-maker images and label-maker package are embedded in the updated script test/integration/test_geotiff_package.py. It seems the test has passed CircleCI. I enjoyed learning this cool stuff! Thank you.

@drewbo
Copy link
Contributor

drewbo commented Apr 17, 2018

Thanks @giswqs!

@drewbo drewbo merged commit 1aff016 into developmentseed:master Apr 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants