-
Notifications
You must be signed in to change notification settings - Fork 4
Feature/sc 488704/support labeldescription in raster loader #174
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
Feature/sc 488704/support labeldescription in raster loader #174
Conversation
…ader' of github.com:CartoDB/raster-loader into feature/sc-488704/support-labeldescription-in-raster-loader
cayetanobv
left a comment
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.
A general note about dependencies: This feature adds GDAL as a dependency; this is a major change, as we previously used Rasterio with the precompiled GDAL included in the Python Wheel. I understand this is because Rasterio doesn't yet include this feature. However, this entails several aspects to keep in mind:
- We need GDAL installed on the system to install and use raster-loader. This wasn't necessary before.
- We use two different GDAL instances in the library: the one preinstalled with Rasterio and the one installed on the system to manage RATs. The versions can be different, and this can cause problems or incompatibilities. One option is not to use the precompiled Rasterio and install it using the system's GDAL; but this complicates the installation significantly.
As soon as Rasterio releases this feature in the next version (maybe), I would consider moving to using Rasterio for RATs for homogeneity in the library: rasterio/rasterio#3252
|
Closing this one in favor of #175, including valuelabels only from the command line option. |
Issue
Fixes #
Proposed Changes
Adding new metadata field by band as
valuelabelsdict of value-labels pairs. i.e:{ "band_1": { "colorinterp": "palette", "nodata": 0, "valuelabels": { "1": "Corn", "5": "Soybeans", "21": "Barley", "121": "Developed/Open Space" }, "colortable": { "1": [255, 211, 0, 255], "5": [37, 111, 0, 255], "21": [226, 0, 124, 255], "121": [153, 153, 153, 255] } } }This dictionary can be obtained from two sources:
1. Via command line parameter
It can be by adding the
--band-valuelabels:For example (Note the
Using the provided valuelabels for band 1in the output:2. Raster Attribute Table (RAT) from the tiff file
For a file-based raster dataset, the raster attribute table must be at the same directory level as the raster, using the same name as the raster but with either the
.vat.dbfor.aux.xmlformat (and extension). For example, for rasterSanDiego.tif, the raster attribute table must beSanDiego.tif.vat.dbforSanDiego.tif.aux.xmlin the same folder.For example, having the files:
And the interactive mode:
Pull Request Checklist
Additional Information
[Anything else you'd like to include.]