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

Unsupported non-integer value as ColorMap keys #187

Closed
cath222ou opened this issue Jan 20, 2020 · 2 comments · Fixed by #206
Closed

Unsupported non-integer value as ColorMap keys #187

cath222ou opened this issue Jan 20, 2020 · 2 comments · Fixed by #206
Assignees
Labels

Comments

@cath222ou
Copy link

cath222ou commented Jan 20, 2020

When we create a color-map with a non-integer value, we get an exception message.

Color-map example:
"ndvi": {
-1.0: 0x1947B0FF,
-0.7: 0x3961B7FF,
-0.5: 0x5A7BBFFF,
-0.4: 0x7B95C6FF,
-0.3: 0x9CB0CEFF,
-0.2: 0xBDCAD5FF,
-0.1: 0xDEE4DDFF,
0: 0xFFFFE5FF,
0.1: 0xDAE4CAFF,
0.2: 0xB6C9AFFF,
0.3: 0x91AF94FF,
0.4: 0x6D9479FF,
0.5: 0x487A5EFF,
0.7: 0x245F43FF,
1.0: 0x004529FF
}

Exception message:

Exception in thread "main" pureconfig.error.ConfigReaderException: Cannot convert configuration to a geotrellis.server.ogc.conf.Conf. Failures are:
at 'layers.2014-ndvi.styles.0.colors.0':
- (file:/opt/datacube/applications/application.conf:732) Expected type STRING. Found OBJECT instead.
at 'layers.2014-ndvi.styles.0.colors.1':
- (file:/opt/datacube/applications/application.conf:740) Expected type STRING. Found OBJECT instead.
at 'layers.2014-ndvi.styles.0.colors.2':
- (file:/opt/datacube/applications/application.conf:746) Expected type STRING. Found OBJECT instead.
at 'layers.2015-ndvi.styles.0.colors.0':
- (file:/opt/datacube/applications/application.conf:732) Expected type STRING. Found OBJECT instead.

@moradology moradology self-assigned this Feb 12, 2020
@moradology
Copy link
Collaborator

It looks like this is an annoying quirk to the HOCON syntax which is most easily worked around by wrapping Double valued keys in quotes - this avoids the parser getting confused about paths. (e.g. -1.0 should become "-1.0").
I'll look into providing some clues in an error message and better documenting this behavior

@moradology
Copy link
Collaborator

Further digging has yielded slightly more favorable results than merely warning: #206

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants