Marble.GeoDataPlacemark

KDE 4.5 PyKDE API Reference

- KDE's Python API

# GeoDataPlacemark Class Reference

`from PyKDE4.marble import *`

Inherits: Marble.GeoDataFeature → Marble.GeoDataObject → Marble.GeoNode
Namespace: Marble.GeoDataPlacemark

## Detailed Description

a class representing a point of interest on the map

This class represents a point of interest, e.g. a city or a mountain. It is filled with data by the KML or GPX loader and the PlacemarkModel makes use of it.

A Placemark can have an associated geometry which will be rendered to the map along with the placemark's point icon. If you would like to render more than one geometry for any one placemark than use

See also:
  setGeometry() to set add a

See also:
  MultiGeometry.

This is more or less only a GeoDataFeature with a geographic position and a country code attached to it. The country code is not provided in a KML file.

## Methods
| __init__ (self)
| __init__ (self, Marble.GeoDataPlacemark placemark)
| __init__ (self, Marble.GeoDataFeature feature)
| __init__ (self, QString name)
float | area (self)
Marble.GeoDataCoordinates | coordinate (self)
QString | countryCode (self)
Marble.GeoDataGeometry | geometry (self)
bool | isPlacemark (self)
QString | nodeType (self)
QXmlStreamWriter | operator << (self, QXmlStreamWriter stream)
bool | operator == (self, Marble.GeoDataPlacemark other)
| pack (self, QDataStream stream)
QXmlStreamWriter | pack (self, QXmlStreamWriter stream)
long | population (self)
| setArea (self, float area)
| setCoordinate (self, float longitude, float latitude, float altitude=0)
| setCoordinate (self, Marble.GeoDataPoint point)
| setCountryCode (self, QString code)
| setGeometry (self, Marble.GeoDataPoint entry)
| setGeometry (self, Marble.GeoDataLineString entry)
| setGeometry (self, Marble.GeoDataLinearRing entry)
| setGeometry (self, Marble.GeoDataMultiGeometry entry)
| setGeometry (self, Marble.GeoDataPolygon entry)
| setPopulation (self, long population)
| unpack (self, QDataStream stream)

## Method Documentation

__init__ | ( |  | self ) |

Create a new placemark.

__init__ | ( | self, |
|  | Marble.GeoDataPlacemark | placemark
| ) |  |  |

Create a new placemark from existing placemark placemark

__init__ | ( | self, |
|  | Marble.GeoDataFeature | feature
| ) |  |  |

Create a new placemark from existing feature feature

__init__ | ( | self, |
|  | QString | name
| ) |  |  |

Create a new placemark with the given name.

float area | ( |  | self ) |

Return the area size of the feature in square km.

FIXME: Once we make Marble more area-aware we need to move this into the GeoDataArea class which will get inherited from GeoDataPlacemark (or GeoDataFeature).

Marble.GeoDataCoordinates coordinate | ( |  | self ) |

Return the coordinate of the placemark as longitude and latitude.

QString countryCode | ( |  | self ) |

Return the country code of the placemark.

Marble.GeoDataGeometry geometry | ( |  | self ) |

The geometry of the GeoDataPlacemark is to be rendered to the marble map along with the icon at the coordinate associated with this Placemark.

Returns:
  a pointer to the current Geometry object

bool isPlacemark | ( |  | self ) |

QString nodeType | ( |  | self ) |

QXmlStreamWriter operator << | ( | self, |
|  | QXmlStreamWriter | stream
| ) |  |  |

bool operator == | ( | self, |
|  | Marble.GeoDataPlacemark | other
| ) |  |  |

comparison operator is implemented slightly different than one would expect. Only Placemarks that are copies of each other are assumed to be equal.

pack | ( | self, |
|  | QDataStream | stream
| ) |  |  |

Serialise this Placemark to a XML stream writer

See also:
  QXmlStreamWriter in the Qt documentation for more info. This will output the XML representation of this Placemark. The default XML format is KML, to have other formats supported you need to create a subclass and override this method.

Parameters:

  | stream | the XML Stream Reader to output to.

QXmlStreamWriter pack | ( | self, |
|  | QXmlStreamWriter | stream
| ) |  |  |

Serialise this Placemark to a XML stream writer

See also:
  QXmlStreamWriter in the Qt documentation for more info. This will output the XML representation of this Placemark. The default XML format is KML, to have other formats supported you need to create a subclass and override this method.

Parameters:

  | stream | the XML Stream Reader to output to.

long population | ( |  | self ) |

Return the population of the placemark.

setArea | ( | self, |
|  | float | area
| ) |  |  |

Set the area size of the feature in square km.

setCoordinate | ( | self, |
|  | float | longitude,
|  | float | latitude,
|  | float | altitude=0
| ) |  |  |

Set the coordinate of the placemark with an GeoDataPoint.

setCoordinate | ( | self, |
|  | Marble.GeoDataPoint | point
| ) |  |  |

Set the coordinate of the placemark with an GeoDataPoint.

setCountryCode | ( | self, |
|  | QString | code
| ) |  |  |

Set the country code of the placemark.

setGeometry | ( | self, |
|  | Marble.GeoDataPoint | entry
| ) |  |  |

Sets the current Geometry of this Placemark.

See also:
  geometry() and the class overview for description of the geometry concept. The geometry can be set to any
  See also:
    GeoDataGeometry like
    See also:
      GeoDataPoint,@see GeoDataLineString,
    See also:
      GeoDataLinearRing and
      See also:
        GeoDataMultiGeometry

setGeometry | ( | self, |
|  | Marble.GeoDataLineString | entry
| ) |  |  |

Sets the current Geometry of this Placemark.

See also:
  geometry() and the class overview for description of the geometry concept. The geometry can be set to any
  See also:
    GeoDataGeometry like
    See also:
      GeoDataPoint,@see GeoDataLineString,
    See also:
      GeoDataLinearRing and
      See also:
        GeoDataMultiGeometry

setGeometry | ( | self, |
|  | Marble.GeoDataLinearRing | entry
| ) |  |  |

Sets the current Geometry of this Placemark.

See also:
  geometry() and the class overview for description of the geometry concept. The geometry can be set to any
  See also:
    GeoDataGeometry like
    See also:
      GeoDataPoint,@see GeoDataLineString,
    See also:
      GeoDataLinearRing and
      See also:
        GeoDataMultiGeometry

setGeometry | ( | self, |
|  | Marble.GeoDataMultiGeometry | entry
| ) |  |  |

Sets the current Geometry of this Placemark.

See also:
  geometry() and the class overview for description of the geometry concept. The geometry can be set to any
  See also:
    GeoDataGeometry like
    See also:
      GeoDataPoint,@see GeoDataLineString,
    See also:
      GeoDataLinearRing and
      See also:
        GeoDataMultiGeometry

setGeometry | ( | self, |
|  | Marble.GeoDataPolygon | entry
| ) |  |  |

Sets the current Geometry of this Placemark.

See also:
  geometry() and the class overview for description of the geometry concept. The geometry can be set to any
  See also:
    GeoDataGeometry like
    See also:
      GeoDataPoint,@see GeoDataLineString,
    See also:
      GeoDataLinearRing and
      See also:
        GeoDataMultiGeometry

setPopulation | ( | self, |
|  | long | population
| ) |  |  |

Sets the population of the placemark.

Parameters:

  |  | population the new population value

unpack | ( | self, |
|  | QDataStream | stream
| ) |  |  |

Deserialize the Placemark from a data stream. This has the opposite effect from

See also:
  pack()

Parameters:

  | stream | the QDataStream to deserialise from.