GeoDataLineString allows LineStrings to be tessellated in order to make them follow the terrain and the curvature of the Earth. The tessellation options allow different ways of visualization:

GeoDataLineString allows LineStrings to be tessellated in order to make them follow the terrain and the curvature of the Earth. The tessellation options allow different ways of visualization:

−

- Not tessellated, connects each two nodes directly

+

* Not tessellated, connects each two nodes directly

−

- A tessellated line, each segment is bent such that the LineString follows the curvature of the Earth and its terrain. A tessellated line segment connects each two nodes at the shortest possible distance ("along great circles").

+

−

- A tessellated line which follows latitude circles whenever possible: in this case latitude circles are followed as soon as two subsequent nodes have exactly the same amount of latitude. In all other places the line segments follow great circles.

+

* A tessellated line, each segment is bent such that the LineString follows the curvature of the Earth and its terrain. A tessellated line segment connects each two nodes at the shortest possible distance ("along great circles").

+

+

* A tessellated line which follows latitude circles whenever possible: in this case latitude circles are followed as soon as two subsequent nodes have exactly the same amount of latitude. In all other places the line segments follow great circles.

If things go fine, execute <tt>./my_marble</tt> and you end up with a globe view similar to this:

If things go fine, execute <tt>./my_marble</tt> and you end up with a globe view similar to this:

−

[[Image:Marble-geopainter.png]]

+

[[Image:GeoDataLineStringTutorial.png]]

−

There may be situations where MarbleWidget::customPaint() does not suit your needs. This can be the case when you don't want to paint at the very top position (above all other items), or when subclassing MarbleWidget is not possible for some reason. In that case, have a look at the next chapter [[Projects/Marble/LayerInterface|Drawing in Custom Layers]]

+

As you can see, the blue line corresponds to the straight-no-tessellation way of visualization, the red one follows the great circles, and the green one sticks to the latitude circles, since the two endpoints have the same latitude.

Revision as of 17:18, 13 January 2013

Painting GeoDataLineString: Using the GeoPainter in order to paint a GeoDataLineString object

The previous tutorial proved how GeoPainter can be used in order to paint shapes and text at different coordinates of the map (through a GeoDataCoordinates parameter) in a MarbleWidget. Now, we'll show a new way of adding extra content to the globe: by painting GeoDataLineString's using our GeoPainter.

Briefly, GeoDataLineString is a tool class which implements LineStrings (also referred to as "polylines"), allowing us to store a contiguous set of line segments. As you will see in the example, it consists of several nodes (GeoDataCoordinates points), which are connected through line segments.

GeoDataLineString allows LineStrings to be tessellated in order to make them follow the terrain and the curvature of the Earth. The tessellation options allow different ways of visualization:

Not tessellated, connects each two nodes directly

A tessellated line, each segment is bent such that the LineString follows the curvature of the Earth and its terrain. A tessellated line segment connects each two nodes at the shortest possible distance ("along great circles").

A tessellated line which follows latitude circles whenever possible: in this case latitude circles are followed as soon as two subsequent nodes have exactly the same amount of latitude. In all other places the line segments follow great circles.

If things go fine, execute ./my_marble and you end up with a globe view similar to this:

As you can see, the blue line corresponds to the straight-no-tessellation way of visualization, the red one follows the great circles, and the green one sticks to the latitude circles, since the two endpoints have the same latitude.