GRASS logo

NAME

v.out.kml - Creates a KML-file from GRASS point/line/polygon vectors

KEYWORDS

SYNOPSIS

v.out.kml
v.out.kml help
v.out.kml [-lypr] map=string [output=string] [ogrpath=string] [color=string] [transparency=string] [fcolor=string] [ftransparency=string] [size=string] [iconcode=string] [iconpalette=string] [iconcolor=string] [icontransparency=string] [iconurl=string] [linecolumn=string] [fillcolumn=string] [linetranscolumn=string] [filltranscolumn=string] [--verbose] [--quiet]

Flags:

-l
Force line-vector export: Areas are exported as lines/polylines (default).
-y
Force polygon export: Areas are exported as polygons with a fillcolor and fill-transparency.
-p
Point-vector (sites) export: Point data are exported.
-r
Random colors: All line and area colors (if needed) are set to random values.
--verbose
Verbose module output
--quiet
Quiet module output

Parameters:

map=string
Vector input map
output=string
Name/path of KML output
ogrpath=string
Optional path to ogr2ogr
color=string
hexcode triplet for line color (blue:green:red 00:00:00-255:255:255)
Default: 00:200:00
transparency=string
integer for vector line transparency (0=invisible 255=opaque)
Default: 255
fcolor=string
hexcode triplet for polygon fill color (blue:green:red 00:00:00-255:255:255)
Default: 00:100:00
ftransparency=string
integer for polygon transparency (00=invisible 255=opaque)
Default: 255
size=string
width of the vector lines (default is 1)
Options: 0.5,1,1.5,2,2.5,3,3.5,4,4.5,5,5.5,6,6.5,7,7.5,8,8.5,9,9.5,10
Default: 1
iconcode=string
Select an icons number within its palette for point-vectors
Options: 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45
Default: 1
iconpalette=string
Select a KML palette of icons for point-vectors
Options: 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20
Default: 1
iconcolor=string
hexcode color triplet for point-vectors (blue:green:red 00:00:00-255:255:255)
Default: 00:200:00
icontransparency=string
integer for point-vector transparency (0=invisible 255=opaque 0-255)
Default: 255
iconurl=string
Provide a URL pointing to a symbol for point-vectors
linecolumn=string
column name string for line color ([xxx]:xxx:xxx:xxx). Transparency should be provided as first value, unless 3-Flag is set.
fillcolumn=string
column name string for area fill color ([xxx]:xxx:xxx:xxx). Transparency should be provided as first value, unless 3-Flag is set.
linetranscolumn=string
column name string for line transparency (xxx). This option is overridden by the 'transparency'-option.
filltranscolumn=string
column name string for fill transparency (xxx). This option is overridden by the 'transparency'-option.

DESCRIPTION

v.out.kml creates KML files from GRASS vector data, including color, fillcolor, transparency and icons.
If no parameters are provided, v.out.kml will ask for the source vector layer and all other parameters.
The script allows to select wether polygons will be reduced to lines or kept as polygons.
Transparency values can be set seperately for both lines and polygon area fills.
Icons for point data can be referenced by ID numbers from the Google Earth web site or by individual URLs.
The color values can also be randomized. The random-color-flag overrides any additional color settings.

Flags

-l
Force line-vector export: Areas are exported as lines/polylines (default) without a fillcolor.
-y
Force polygon export: Areas are exported as polygons with a fillcolor and fill-transparency.
-p
Point-vector (sites) export: Point data will be exported.
-r
Random colors: All line and area colors (if needed) are set to random values

Parameters

vector
Vector input map.
output
Name/path of kml output.
ogrpath
optional path to ogr2ogr.
color
integer triplet for line color (blue:green:red 00:00:00-255:255:255).
transparency
integer for vector line transparency (0=invisible 255=opaque) Standard: 255.
fcolor
integer triplet for polygon fill color (blue:green:red 00:00:00-255:255:255).
ftransparency
integer for polygon transparency (00=invisible 255=opaque) Standard: 255.
size
width of the vector lines (default is 1).
iconcode
Select an icons number within its palette for point-vectors. Options: 1-45.
iconpalette
Select a KML palette of icons for point-vectors. Options: 1-20 .
iconcolor
hexcode color triplet for point-vectors (blue:green:red 00:00:00-255:255:255) Standard: 00:200:00.
icontransparency
integer for point-vector transparency (0=invisible 255=opaque 0-255) Standard: 255.
iconurl
Provide a URL pointing to a symbol for point-vectors .
linecolumn
The name of a database column providing the line color as an integer triplet (blue:green:red 0:0:0 - 255:255:255)
linetranscolumn
The name of a database column providing the line transparency as an integer value (0-255 0=invisible 255=opaque)
fillcolumn
The name of a database column providing the line color as an integer triplet (blue:green:red 0:0:0 - 255:255:255)
filltranscolumn
The name of a database column providing the line transparency as an integer value (0-255 0=invisible 255=opaque)

Notes

The script only works for data layers of the current mapset. If "user" is the current mapset, trying to access vectors from other mapsets (like "PERMANENT") will cause ungraceful script termination.
The scrip requires an installation of GDAL/OGR supporting GML (Geographic Markup Language). If for some reason this is not available, or the local GDAL/OGR does not provide GML, install FWTools from http://fwtools.maptools.org. They provide GML support. To point the script to such a FWtools installation, use the ogrpath-parameter (pointing to ogr2ogr in FWtools). Once started with this option, the script will remember the path for the current mapset, so this ordeal is only necessary once.

To be done

Currently lacking database support for point data (color/transparency)
The same random value will be applied to all instances of a [transparency|geometry]-class.
There might be a slight offset between the generic EPSG 4326 and the "lat lon" used by Google Earth. The author would be grateful for feedback on this issue.

AUTHOR

Peter Loewe, GISIX.com


Main index - vector index - Full index

© 2003-2016 GRASS Development Team