KML (Shape) Format

KML Shapes
This will provide a KML response that provides a geographic shape of the requested weather data that can be viewed in two-dimensional maps or three-dimensional Earth browsers, like Google Earth.

Example KML (Shape) format data request:

NOTE:  For use in Google Earth -- First open Google Earth.  Click on “Add” at the top and select “Network Link” from the menu.  Insert the DataCloud API request (like the one below) in the box labeled “Link”.  Click “OK”.

http://datacloud.wxc.com/?passkey=123456789&vs=1.0&datatype=forecast&format=kml&comparison=
greaterthan&threshold=
0.01&type=shape&lonleft=-100&lonright=-70&latupper=50&latlower=25&var=accumraintotal&time=now

Example KML (Shape) format data response in Google Earth:

Example KML (Shape) format data response in XML:

NOTE:  For information on the meaning and usage of XML elements, please refer to the following page:  http://code.google.com/apis/kml/documentation/kmlreference.html

REQUIRED PARAMETERS

type
This specifies that this request is asking for a polygon shape.
Usage:

type=shape

format
This specifies the request is for a KML response that provides a geographic shape of a weather data variable that can be viewed in two-dimensional maps or three-dimensional Earth browsers, like Google Earth.
Usage:

format=kml

var
This specifies the weather data variable you wish to display a KML shape for.
Usage:

var=accumraintotal

comparison
This determines the type of comparison you wish to perform against a threshold value (defined below).
Usage:

comparison=greaterthan
comparison=lessthan
comparison=greaterthanorequal
comparison=lessthanorequal

threshold
This determines the threshold value of the weather variable shape you are requesting to see.  You may request to show shapes that are greater than, less than, greather than or equal to, or less than or equal to the threshold value, using the comparison request (above).
Usage:

threshold=0.01

time
This specifies the valid time for which to display the KML shape.  If specifying a future time, the format is YYYY-MM-DDTHH:MM:SS.  Only single times are supported, not ranges.
Usage:

time=now
time=2011-05-25T12:00:00

lonleft
This defines the left-most longitude, in degrees, of the bounding box in which to show KML shapes.  West is indicated by a negative sign.  The default bounding box is the entire globe.
Usage:

lonleft=-100

lonright
This defines the right-most longitude, in degrees, of the bounding box in which to show KML shapes.  West is indicated by a negative sign.  The default bounding box is the entire globe.
Usage:

lonright=-70

latupper
This defines the upper-most latitude, in degrees, of the bounding box in which to show KML shapes.  South is indicated by a negative sign.  The default bounding box is the entire globe.
Usage:

latupper=50

latlower
This defines the lower-most latitude, in degrees, of the bounding box in which to show KML shapes.  South is indicated by a negative sign.  The default bounding box is the entire globe.
Usage:

latlower=25

OPTIONAL PARAMETERS

linewidth
This defines the width of the outline surrounding the polygon shape, in pixels.
Usage:

linewidth=10

linecolor
This defines the color of the outline surrounding the polygon shape.  This color can be defined by either its RGB values, or its common name.  If using RGB values, follow the format Red:Green:Blue:Alpha.
Usage:

linecolor=50:200:50:0                                               
linecolor=green

polycolor
This defines the color of the filled polygon shape.  This color can be defined by either its RGB values, or its common name.  If using RGB values, follow the format Red:Green:Blue:Alpha.
Usage:

polycolor=50:200:50:0
polycolor=green

levelofdetail
This defines the smoothness of the shape, in pixels per degrees.  Default value is 0.1
Usage:

levelofdetail=0.05

kmltime
This determines whether a timestamp is returned for a KML request.  Default value is set to ‘true’ which will return a timestamp.  If kmltime is set to ‘false’ a timestamp will not be returned.
Usage:

kmltime=false

filter
This determines the type of filtering that is applied to the shape.  Default value is bilinear, which is a linear interpolation of the nearest grid points to the rendering of the target point. This option adds a degree of smoothing to the data.  Choosing the option "nearest" uses the closest grid point to render the target grid point. It provides no degree of smoothing; maximum and minimum values will not be smoothed.
Usage:

filter=nearest