Updated RasterColorizer (markdown)
parent
a4d1973be8
commit
fac1c58340
1 changed files with 43 additions and 40 deletions
|
@ -81,6 +81,7 @@ In this example XML, the following value to color translation is performed:
|
||||||
* 18 <= x < 100 green blending to indigo
|
* 18 <= x < 100 green blending to indigo
|
||||||
|
|
||||||
|
|
||||||
|
```xml
|
||||||
#!xml
|
#!xml
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Map srs="+proj=latlong +datum=WGS84">
|
<Map srs="+proj=latlong +datum=WGS84">
|
||||||
|
@ -109,8 +110,8 @@ In this example XML, the following value to color translation is performed:
|
||||||
<Parameter name="band">1</Parameter>
|
<Parameter name="band">1</Parameter>
|
||||||
</Datasource>
|
</Datasource>
|
||||||
</Layer>
|
</Layer>
|
||||||
|
|
||||||
</Map>
|
</Map>
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
# Python Bindings
|
# Python Bindings
|
||||||
|
@ -140,6 +141,7 @@ This is the enumeration of the stop modes. The values are _mapnik2.COLORIZER_LIN
|
||||||
## Example Python
|
## Example Python
|
||||||
|
|
||||||
|
|
||||||
|
```python
|
||||||
#!py
|
#!py
|
||||||
import mapnik2
|
import mapnik2
|
||||||
c = mapnik2.RasterColorizer( mapnik2.COLORIZER_DISCRETE , mapnik2.Color(0,0,0,255) )
|
c = mapnik2.RasterColorizer( mapnik2.COLORIZER_DISCRETE , mapnik2.Color(0,0,0,255) )
|
||||||
|
@ -150,3 +152,4 @@ This is the enumeration of the stop modes. The values are _mapnik2.COLORIZER_LIN
|
||||||
c.add_stop(30.25, mapnik2.COLORIZER_LINEAR, mapnik2.Color("green"))
|
c.add_stop(30.25, mapnik2.COLORIZER_LINEAR, mapnik2.Color("green"))
|
||||||
c.get_color(23.124)
|
c.get_color(23.124)
|
||||||
c.stops[1].color
|
c.stops[1].color
|
||||||
|
```
|
||||||
|
|
Loading…
Reference in a new issue