[gdal-dev] Layer/Object colors on Map

Jukka Rahkonen jukka.rahkonen at mmmtike.fi
Wed Dec 26 06:48:31 PST 2012


srikanthsidduri <srikanth.sidduri <at> iictechnologies.com> writes:

> 
> Hi,
> 
>  How can we set specific colors to the layers based on their attribute
> values.
> Here I am getting different colors for all layers(getting different colors
> when I reloading the same dataset)
> Here is the sample map.
> 
> <http://osgeo-org.1560.n6.nabble.com/file/n5024604/MapColor.jpg> 
> 
> The colors given in the map are not relavent to the objects.

You can set colors with OGR Feature Styles
http://www.gdal.org/ogr/ogr_feature_style.html

It is another thing if your client can utilize the stores colors. Mapserver does
http://mapserver.org/development/rfc/ms-rfc-61.html. GDAL PDF driver has also a
limited support and you can read a bit about that from this how-to 
http://latuviitta.org/documents/Geospatial_PDF_maps_from_OSM_with_GDAL.pdf

I do not know which GDAL/OGR drivers clients support reading/writing/converting
OGR styles but such a list would be nice to have.

-Jukka Rahkonen-





More information about the gdal-dev mailing list