Polygon Functions

The following functions provide various routines for adding, removing, and updating Polygons in Google Earth. More...

Functions

int GE_GetPolygonCount ()
 Returns the current number of Polygons added to the Google Earth map by the GE SDK.
BOOL GE_RefreshPolygon (STRING polygon_name)
 Forces an update to the Polygon with the given polygon name.
BOOL GE_AddPolygon (STRING polygon_name, STRING outer_boundary_points, STRING color)
 Adds a new Polygon with the given outer boundary to Google Earth.
BOOL GE_DeletePolygon (STRING polygon_name)
 Removes the Polygon with the given name from the Google Earth map.
BOOL GE_PolygonExists (STRING polygon_name, int *index)
 Determines if a Polygon with the given name has been added to Google Earth by the GE SDK.
BOOL GE_PolygonVisible (STRING polygon_name)
 Determines if the Polygon with the given name is currently visible in Google Earth.
BOOL GE_ShowPolygon (STRING polygon_name)
 Sets the Polygon with the given name to visible.
BOOL GE_HidePolygon (STRING polygon_name)
 Sets the Polygon with the given name to invisible.
STRING GE_GetPolygonName (int index)
 Retrieves the name of the Polygon at the given index.
BOOL GE_SetPolygonName (STRING polygon_name, STRING new_name)
 Changes the name of a Polygon.
STRING GE_GetPolygonSnippet (STRING polygon_name)
 Retrieves a Polygon's snippet.
BOOL GE_SetPolygonSnippet (STRING polygon_name, STRING snippet)
 Changes the snippet of the given Polygon.
int GE_GetPolygonSnippetMaxLines (STRING polygon_name)
 Retrieves the given Polygon's snippet maxLines attribute value.
BOOL GE_SetPolygonSnippetMaxLines (STRING polygon_name, int max_lines)
 Changes the snippet maxLines attribute value for the given Polygon.
STRING GE_GetPolygonKML (STRING polygon_name)
 Retrieves the KML content that makes up the given Polygon.
STRING GE_GetPolygonDescription (STRING polygon_name)
 Retrieves the description of the given Polygon.
BOOL GE_SetPolygonDescription (STRING polygon_name, STRING description)
 Sets the description of the given Polygon.
BOOL GE_GetPolygonExtrude (STRING polygon_name)
 Retrieves the given Polygon's extrude state.
BOOL GE_SetPolygonExtrude (STRING polygon_name, BOOL extrude)
 Sets the given Polygon's extrude state.
BOOL GE_GetPolygonTessellate (STRING polygon_name)
 Retrieves the given Polygon tessellate state.
BOOL GE_SetPolygonTessellate (STRING polygon_name, BOOL tessellate)
 Sets the given Polygon tessellate state.
int GE_GetPolygonAltMode (STRING polygon_name)
 Retrieves the altitude mode of the given Polygon.
BOOL GE_SetPolygonAltMode (STRING polygon_name, int alt_mode)
 Sets the altitude mode of the given Polygon.
STRING GE_GetPolygonColor (STRING polygon_name)
 Retrieves the given Polygon's current boundary color.
BOOL GE_SetPolygonColor (STRING polygon_name, STRING color)
 Sets the given Polygon's boundary color.
BOOL GE_GetPolygonOutline (STRING polygon_name)
 Retrieves the given Polygon's outline state.
BOOL GE_SetPolygonOutline (STRING polygon_name, BOOL outline)
 Sets the given Polygon's outline state.
STRING GE_GetPolygonOutlineColor (STRING polygon_name)
 Retrieves the given Polygon's current outline color.
BOOL GE_SetPolygonOutlineColor (STRING polygon_name, STRING color)
 Sets the given Polygon's outline color.
float GE_GetPolygonOutlineWidth (STRING polygon_name)
 Retrieves the width of the given Polygon's outline.
BOOL GE_SetPolygonOutlineWidth (STRING polygon_name, float width)
 Sets the given Polygon's outline width.
BOOL GE_GetPolygonFill (STRING polygon_name)
 Retrieves the given Polygon's fill state.
BOOL GE_SetPolygonFill (STRING polygon_name, BOOL fill)
 Sets the given Polygon's fill state.
int GE_GetPolygonOuterBoundaryPointCount (STRING polygon_name)
 Retrieves the total count of geographical points for the given Polygon's outer boundary.
STRING GE_GetPolygonOuterBoundary (STRING polygon_name)
 Retrieves a string of all coordinate points for the given Polygon's outer boundary.
STRING GE_GetPolygonOuterBoundaryPointStr (STRING polygon_name, int point_index)
 Retrieves the outer boundary point at the specified index for the given Polygon.
double * GE_GetPolygonOuterBoundaryPoint (STRING polygon_name, int point_index)
 Retrieves a 3-element array of the outer boundary point at the specified index for the given Polygon.
BOOL GE_SetPolygonOuterBoundary (STRING polygon_name, STRING points)
 Sets the linear ring outer boundary coordinate points for the given Polygon.
BOOL GE_SetPolygonOuterBoundaryPoint (STRING polygon_name, int point_index, double lat, double lon, double alt)
 Sets the specified outer boundary coordinate point of the given Polygon.
double GE_GetPolygonOuterBoundaryPerimeter (STRING polygon_name)
 Retrieves the perimeter (in miles) of the given Polygon's outer boundary.
double * GE_GetPolygonAveragedCenterPoint (STRING polygon_name)
 Retrieves a 3-element array for the Polygon's computed center point.
int GE_GetPolygonInnerBoundaryCount (STRING polygon_name)
 Retrieves the total count of inner boundaries of the given Polygon.
int GE_GetPolygonInnerBoundaryPointCount (STRING polygon_name, int boundary_index)
 Retrieves the total count of geographical points for the given Polygon's specified inner boundary.
STRING GE_GetPolygonInnerBoundary (STRING polygon_name, int boundary_index)
 Retrieves a string of all coordinate points for the given Polygon's specified inner boundary.
STRING GE_GetPolygonInnerBoundaryPointStr (STRING polygon_name, int boundary_index, int point_index)
 Retrieves the inner boundary point at the specified index and boundary for the given Polygon.
double * GE_GetPolygonInnerBoundaryPoint (STRING polygon_name, int boundary_index, int point_index)
 Retrieves a 3-element array of the inner boundary point at the specified index and boundary for the given Polygon.
BOOL GE_AddPolygonInnerBoundary (STRING polygon_name, STRING points)
 Adds an inner boundary linear ring of coordinate points to the given Polygon.
BOOL GE_SetPolygonInnerBoundary (STRING polygon_name, int boundary_index, STRING points)
 Sets the Polygon's linear ring inner boundary coordinate points for specified boundary.
BOOL GE_SetPolygonInnerBoundaryPoint (STRING polygon_name, int boundary_index, int point_index, double lat, double lon, double alt)
 Sets the specified inner boundary coordinate point of the given Polygon.
double GE_GetPolygonInnerBoundaryPerimeter (STRING polygon_name, int boundary_index)
 Retrieves the perimeter (in miles) of the given Polygon's specified inner boundary.
BOOL GE_MovePolygon (STRING polygon_name, double lat, double lon, double alt)
 Moves the given Polygon.

Detailed Description

The following functions provide various routines for adding, removing, and updating Polygons in Google Earth.

Polygons represent an enclosed boundary with zero or more inner boundaries. Each boundary is defined by a set of 3 or more coordinate points. Polygon boundaries can be constructed to represent 3-dimensional structures such as buildings, borders, or any other conceivable object.


Function Documentation

int GE_GetPolygonCount (  ) 

Returns the current number of Polygons added to the Google Earth map by the GE SDK.

Returns:
The current number of Polygons added to Google Earth; -1 otherwise
BOOL GE_RefreshPolygon ( STRING  polygon_name  ) 

Forces an update to the Polygon with the given polygon name.

Parameters:
polygon_name The name of the Polygon to update
Returns:
TRUE if the function executed properly; FALSE otherwise
BOOL GE_AddPolygon ( STRING  polygon_name,
STRING  outer_boundary_points,
STRING  color 
)

Adds a new Polygon with the given outer boundary to Google Earth.

Parameters:
polygon_name The name of the Polygon to update
outer_boundary_points A group of 3 or more 3-tuple coordinate points (longitude,latitude,altitude) that construct the Polygon's outer boundary
color A string representing the color of the boundary formatted as aabbggrr, where aa is opacity, bb is blue, gg is green, and rr is red.
Returns:
TRUE if the function executed properly; FALSE otherwise
BOOL GE_DeletePolygon ( STRING  polygon_name  ) 

Removes the Polygon with the given name from the Google Earth map.

Parameters:
polygon_name The name of the Polygon to remove
Returns:
TRUE if the function executed properly; FALSE otherwise
BOOL GE_PolygonExists ( STRING  polygon_name,
int *  index 
)

Determines if a Polygon with the given name has been added to Google Earth by the GE SDK.

If the function returns TRUE, then the index parameter will contain a value that represents the index into the GE SDK internal Polygon collection.

Parameters:
polygon_name The name of the Polygon
index The index into the internal Polygon collection where polygon_name exists if found
Returns:
TRUE if a Polygon with name polygon_name exists in the internal Polygon collection; FALSE otherwise
BOOL GE_PolygonVisible ( STRING  polygon_name  ) 

Determines if the Polygon with the given name is currently visible in Google Earth.

Parameters:
polygon_name The name of the Polygon
Returns:
TRUE if the given Polygon is visible; FALSE if not visible
BOOL GE_ShowPolygon ( STRING  polygon_name  ) 

Sets the Polygon with the given name to visible.

Parameters:
polygon_name The name of the Polygon
Returns:
TRUE if the function executed properly; FALSE otherwise
BOOL GE_HidePolygon ( STRING  polygon_name  ) 

Sets the Polygon with the given name to invisible.

Parameters:
polygon_name The name of the Polygon
Returns:
TRUE if the function executed properly; FALSE otherwise
STRING GE_GetPolygonName ( int  index  ) 

Retrieves the name of the Polygon at the given index.

Parameters:
index The index into the internal Polygon collection
Returns:
The name of the Polygon at the given index; otherwise the empty string ("") is returned
BOOL GE_SetPolygonName ( STRING  polygon_name,
STRING  new_name 
)

Changes the name of a Polygon.

Parameters:
polygon_name The name of an existing Polygon to be renamed
new_name The new name to be given to the Polygon
Returns:
TRUE if the function executed properly; FALSE otherwise
STRING GE_GetPolygonSnippet ( STRING  polygon_name  ) 

Retrieves a Polygon's snippet.

Parameters:
polygon_name The name of the Polygon
Returns:
The snippet of the given Polygon; otherwise the empty string ("") is returned
BOOL GE_SetPolygonSnippet ( STRING  polygon_name,
STRING  snippet 
)

Changes the snippet of the given Polygon.

Parameters:
polygon_name The name of the Polygon
snippet The snippet to be applied to the given Polygon
Returns:
TRUE if the function executed properly; FALSE otherwise
int GE_GetPolygonSnippetMaxLines ( STRING  polygon_name  ) 

Retrieves the given Polygon's snippet maxLines attribute value.

Parameters:
polygon_name The name of the Polygon
Returns:
The snippet maxLines attribute value; -1 otherwise
BOOL GE_SetPolygonSnippetMaxLines ( STRING  polygon_name,
int  max_lines 
)

Changes the snippet maxLines attribute value for the given Polygon.

Parameters:
polygon_name The name of the Polygon
max_lines The value to be applied to the maxLines attribute
Returns:
TRUE if the function executed properly; FALSE otherwise
STRING GE_GetPolygonKML ( STRING  polygon_name  ) 

Retrieves the KML content that makes up the given Polygon.

Parameters:
polygon_name The name of the Polygon
Returns:
A string containing the KML data of the given Polygon; otherwise the empty string ("") is returned
STRING GE_GetPolygonDescription ( STRING  polygon_name  ) 

Retrieves the description of the given Polygon.

Parameters:
polygon_name The name of the Polygon
Returns:
The current description for the given Polygon; otherwise the empty string ("") is returned
BOOL GE_SetPolygonDescription ( STRING  polygon_name,
STRING  description 
)

Sets the description of the given Polygon.

Parameters:
polygon_name The name of the Polygon
description The description to apply to the Model
Returns:
TRUE if the function executed properly; FALSE otherwise
BOOL GE_GetPolygonExtrude ( STRING  polygon_name  ) 

Retrieves the given Polygon's extrude state.

Parameters:
polygon_name The name of the Polygon
Returns:
TRUE if the given Polygon's <extrude> value is 1; FALSE otherwise
BOOL GE_SetPolygonExtrude ( STRING  polygon_name,
BOOL  extrude 
)

Sets the given Polygon's extrude state.

Parameters:
polygon_name The name of the Polygon
extrude The state to be applied to the given Polygon's <extrude> element
Returns:
TRUE if the function executed properly; FALSE otherwise
BOOL GE_GetPolygonTessellate ( STRING  polygon_name  ) 

Retrieves the given Polygon tessellate state.

Parameters:
polygon_name The name of the Polygon
Returns:
TRUE if the given Polygon <tessellate> value is 1; FALSE otherwise
BOOL GE_SetPolygonTessellate ( STRING  polygon_name,
BOOL  tessellate 
)

Sets the given Polygon tessellate state.

Parameters:
polygon_name The name of the Polygon
tessellate The state to be applied to the given Polygon <tessellate> element
Returns:
TRUE if the function executed properly; FALSE otherwise
int GE_GetPolygonAltMode ( STRING  polygon_name  ) 

Retrieves the altitude mode of the given Polygon.

Parameters:
polygon_name The name of the Polygon
Returns:
Altitude mode for the given Polygon (relativeToGround (0), absolute (1), or clampToGround (2)); -1 otherwise
BOOL GE_SetPolygonAltMode ( STRING  polygon_name,
int  alt_mode 
)

Sets the altitude mode of the given Polygon.

Parameters:
polygon_name The name of the Polygon
alt_mode Altitude mode for the given Polygon (relativeToGround (0), absolute (1), or clampToGround (2))
Returns:
TRUE if the function executed properly; FALSE otherwise
STRING GE_GetPolygonColor ( STRING  polygon_name  ) 

Retrieves the given Polygon's current boundary color.

Parameters:
polygon_name The name of the Polygon
Returns:
A string representation of the given Polygon's color formatted as aabbggrr, where aa is opacity, bb is blue, gg is green, and rr is red; otherwise the empty string ("") is returned
BOOL GE_SetPolygonColor ( STRING  polygon_name,
STRING  color 
)

Sets the given Polygon's boundary color.

Parameters:
polygon_name The name of the Polygon
color A string representing the color formatted as aabbggrr, where aa is opacity, bb is blue, gg is green, and rr is red.
Returns:
TRUE if the function executed properly; FALSE otherwise
BOOL GE_GetPolygonOutline ( STRING  polygon_name  ) 

Retrieves the given Polygon's outline state.

Parameters:
polygon_name The name of the Polygon
Returns:
TRUE if the given Polygon's <outline> value is 1; FALSE otherwise
BOOL GE_SetPolygonOutline ( STRING  polygon_name,
BOOL  outline 
)

Sets the given Polygon's outline state.

Parameters:
polygon_name The name of the Polygon
outline The state to be applied to the given Polygon's <outline> element
Returns:
TRUE if the function executed properly; FALSE otherwise
STRING GE_GetPolygonOutlineColor ( STRING  polygon_name  ) 

Retrieves the given Polygon's current outline color.

Parameters:
polygon_name The name of the Polygon
Returns:
A string representation of the given Polygon's outline color formatted as aabbggrr, where aa is opacity, bb is blue, gg is green, and rr is red; otherwise the empty string ("") is returned
BOOL GE_SetPolygonOutlineColor ( STRING  polygon_name,
STRING  color 
)

Sets the given Polygon's outline color.

Parameters:
polygon_name The name of the Polygon
color A string representing the Polygon's outline color formatted as aabbggrr, where aa is opacity, bb is blue, gg is green, and rr is red
Returns:
TRUE if the function executed properly; FALSE otherwise
float GE_GetPolygonOutlineWidth ( STRING  polygon_name  ) 

Retrieves the width of the given Polygon's outline.

Parameters:
polygon_name The name of the Polygon
Returns:
A decimal value representing the Polygon's outline width; BAD_DOUBLE otherwise
BOOL GE_SetPolygonOutlineWidth ( STRING  polygon_name,
float  width 
)

Sets the given Polygon's outline width.

Parameters:
polygon_name The name of the Polygon
width The width of the Polygon's outline in pixels
Returns:
TRUE if the function executed properly; FALSE otherwise
BOOL GE_GetPolygonFill ( STRING  polygon_name  ) 

Retrieves the given Polygon's fill state.

Parameters:
polygon_name The name of the Polygon
Returns:
TRUE if the given Polygon's <fill> value is 1; FALSE otherwise
BOOL GE_SetPolygonFill ( STRING  polygon_name,
BOOL  fill 
)

Sets the given Polygon's fill state.

Parameters:
polygon_name The name of the Polygon
fill The state to be applied to the given Polygon's <fill> element
Returns:
TRUE if the function executed properly; FALSE otherwise
int GE_GetPolygonOuterBoundaryPointCount ( STRING  polygon_name  ) 

Retrieves the total count of geographical points for the given Polygon's outer boundary.

Parameters:
polygon_name The name of the Polygon
Returns:
The current count of points in the Polygon's outer boundary; -1 otherwise
STRING GE_GetPolygonOuterBoundary ( STRING  polygon_name  ) 

Retrieves a string of all coordinate points for the given Polygon's outer boundary.

Parameters:
polygon_name The name of the Polygon
Returns:
A string of the Polygon's outer boundary <coordinates> element; otherwise the empty string ("") is returned
STRING GE_GetPolygonOuterBoundaryPointStr ( STRING  polygon_name,
int  point_index 
)

Retrieves the outer boundary point at the specified index for the given Polygon.

Parameters:
polygon_name The name of the Polygon
point_index The index of the outer boundary coordinate point
Returns:
A comma-delimted string of the Polygon's specified 3-tuple coordinate point values (longitude,latitude,altitude); otherwise the empty string ("") is returned
double* GE_GetPolygonOuterBoundaryPoint ( STRING  polygon_name,
int  point_index 
)

Retrieves a 3-element array of the outer boundary point at the specified index for the given Polygon.

Parameters:
polygon_name The name of the Polygon
point_index The index of the outer boundary coordinate point
Returns:
A 3-element array of the following decimal values: [latitude, longitude, altitude] where latitude and longitude are expressed in degrees and altitude is expressed in meters; NULL otherwise
BOOL GE_SetPolygonOuterBoundary ( STRING  polygon_name,
STRING  points 
)

Sets the linear ring outer boundary coordinate points for the given Polygon.

Parameters:
polygon_name The name of the Polygon
points A set of geographical points to be applied to the given Polygon's outer boundary <coordinates> element
Returns:
TRUE if the function executed properly; FALSE otherwise
BOOL GE_SetPolygonOuterBoundaryPoint ( STRING  polygon_name,
int  point_index,
double  lat,
double  lon,
double  alt 
)

Sets the specified outer boundary coordinate point of the given Polygon.

Parameters:
polygon_name The name of the Polygon
point_index The index of the outer boundary coordinate point to set
lat The latitude of the point
lon The longitude of the point
alt The altitude of the point
Returns:
TRUE if the function executed properly; FALSE otherwise
double GE_GetPolygonOuterBoundaryPerimeter ( STRING  polygon_name  ) 

Retrieves the perimeter (in miles) of the given Polygon's outer boundary.

Parameters:
polygon_name The name of the Polygon
Returns:
The computed perimeter in miles of the Polygon's outer boundary
double* GE_GetPolygonAveragedCenterPoint ( STRING  polygon_name  ) 

Retrieves a 3-element array for the Polygon's computed center point.

Parameters:
polygon_name The name of the Polygon
Returns:
A 3-element array of the averaged coordinate point [latitude, longitude, altitude] of the Polygon; NULL otherwise
int GE_GetPolygonInnerBoundaryCount ( STRING  polygon_name  ) 

Retrieves the total count of inner boundaries of the given Polygon.

Parameters:
polygon_name The name of the Polygon
Returns:
The current count of inner boundaries contained within the Polygon; -1 otherwise
int GE_GetPolygonInnerBoundaryPointCount ( STRING  polygon_name,
int  boundary_index 
)

Retrieves the total count of geographical points for the given Polygon's specified inner boundary.

Parameters:
polygon_name The name of the Polygon
boundary_index The index of the inner boundary
Returns:
The current count of points in the specified inner boundary; -1 otherwise
STRING GE_GetPolygonInnerBoundary ( STRING  polygon_name,
int  boundary_index 
)

Retrieves a string of all coordinate points for the given Polygon's specified inner boundary.

Parameters:
polygon_name The name of the Polygon
boundary_index The index of the inner boundary
Returns:
A string of the Polygon's specified inner boundary <coordinates> element; otherwise the empty string ("") is returned
STRING GE_GetPolygonInnerBoundaryPointStr ( STRING  polygon_name,
int  boundary_index,
int  point_index 
)

Retrieves the inner boundary point at the specified index and boundary for the given Polygon.

Parameters:
polygon_name The name of the Polygon
boundary_index The index of the inner boundary
point_index The index of the inner boundary coordinate point
Returns:
A comma-delimted string of the Polygon's specified 3-tuple coordinate point values (longitude,latitude,altitude); otherwise the empty string ("") is returned
double* GE_GetPolygonInnerBoundaryPoint ( STRING  polygon_name,
int  boundary_index,
int  point_index 
)

Retrieves a 3-element array of the inner boundary point at the specified index and boundary for the given Polygon.

Parameters:
polygon_name The name of the Polygon
boundary_index The index of the inner boundary
point_index The index of the inner boundary coordinate point
Returns:
A 3-element array of the following decimal values: [latitude, longitude, altitude] where latitude and longitude are expressed in degrees and altitude is expressed in meters; NULL otherwise
BOOL GE_AddPolygonInnerBoundary ( STRING  polygon_name,
STRING  points 
)

Adds an inner boundary linear ring of coordinate points to the given Polygon.

Parameters:
polygon_name The name of the Polygon
points A set of geographical points to be applied to the given Polygon
Returns:
TRUE if the function executed properly; FALSE otherwise
BOOL GE_SetPolygonInnerBoundary ( STRING  polygon_name,
int  boundary_index,
STRING  points 
)

Sets the Polygon's linear ring inner boundary coordinate points for specified boundary.

Parameters:
polygon_name The name of the Polygon
boundary_index The index of the inner boundary
points A set of geographical points to be applied to the given Polygon
Returns:
TRUE if the function executed properly; FALSE otherwise
BOOL GE_SetPolygonInnerBoundaryPoint ( STRING  polygon_name,
int  boundary_index,
int  point_index,
double  lat,
double  lon,
double  alt 
)

Sets the specified inner boundary coordinate point of the given Polygon.

Parameters:
polygon_name The name of the Polygon
boundary_index The index of the inner boundary
point_index The index of the inner boundary coordinate point
lat The latitude of the point
lon The longitude of the point
alt The altitude of the point
Returns:
TRUE if the function executed properly; FALSE otherwise
double GE_GetPolygonInnerBoundaryPerimeter ( STRING  polygon_name,
int  boundary_index 
)

Retrieves the perimeter (in miles) of the given Polygon's specified inner boundary.

Parameters:
polygon_name The name of the Polygon
boundary_index The index of the inner boundary
Returns:
The computed perimeter in miles of the Polygon's specified inner boundary
BOOL GE_MovePolygon ( STRING  polygon_name,
double  lat,
double  lon,
double  alt 
)

Moves the given Polygon.

The Polygon's position is moved in reference to the averaged center point.

Parameters:
polygon_name The name of the Polygon
lat The latitude of the point to move to
lon The longitude of the point to move to
alt The altitude of the point to move to
Returns:
TRUE if the function executed properly; FALSE otherwise

Generated on Wed Sep 16 23:50:34 2009 for Google Earth SDK by  doxygen 1.6.1