-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from pblottiere/raster_layer_rendering
Add basic support for raster style
- Loading branch information
Showing
13 changed files
with
611 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,5 @@ docs/build | |
sandbox/projects | ||
*.aux.xml | ||
map.png | ||
map_vector.png | ||
map_raster.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Sandbox : raster styles | ||
|
||
|
||
### Add style to project | ||
|
||
To add a style for a multiband raster layer: | ||
|
||
```` shell | ||
$ curl "http://localhost:5000/api/projects/my_project/styles?schema=my_schema" \ | ||
-X POST \ | ||
-H 'Content-Type: application/json' \ | ||
-d '{ | ||
"type": "raster", | ||
"name": "my_singlebandgray_style", | ||
"symbology": { | ||
"type": "singlebandgray", | ||
"properties": { | ||
"gray_band": 1 | ||
} | ||
}, | ||
"rendering": { | ||
"brightness": 255, | ||
"gamma": 0.1, | ||
"contrast": 100 | ||
} | ||
}' | ||
true | ||
```` | ||
|
||
To list styles for a specific project: | ||
|
||
```` shell | ||
$ curl "http://localhost:5000/api/projects/my_project/styles?schema=my_schema" | ||
["my_singlebandgray_style"] | ||
```` | ||
|
||
|
||
### Apply style to layer | ||
|
||
To apply a specific style to a layer: | ||
|
||
```` shell | ||
$ curl "http://localhost:5000/api/projects/my_project/layers/dem/style?schema=my_schema" \ | ||
-X POST \ | ||
-H 'Content-Type: application/json' \ | ||
-d '{ | ||
"name":"my_singlebandgray_style", | ||
"current":true | ||
}' | ||
true | ||
```` | ||
|
||
The layer rendering has changed now: | ||
|
||
```` shell | ||
$ curl "http://localhost:5000/api/projects/my_project/layers/dem/map?schema=my_schema" --output map.png | ||
```` | ||
|
||
<img src="../../images/map_raster_style.png" width="300"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Oops, something went wrong.