[Marble-devel] Review Request: Default range normalization of GeoDataCoordinates

Dennis Nienhüser earthwings at gentoo.org
Sat May 19 09:15:51 UTC 2012

This is an automatically generated e-mail. To reply, visit:

Review request for Marble.


We don't officially support non-normalized coordinates (lon outside -180...180 degree, lat outside -90..90 degree). To avoid potential pitfalls when developers using Marble as a library ignore that, it might make sense to normalize coordinates behind the scenes. The patch adds that for GeoDataCoordinates, which should cover most cases. It's controlled by a flag (using QFlags for future extensibility) which defaults to normalization.


  src/lib/geodata/data/GeoDataCoordinates.h 8929430 
  src/lib/geodata/data/GeoDataCoordinates.cpp c1563a6 
  src/lib/geodata/data/GeoDataCoordinates_p.h 14c5164 

Diff: http://git.reviewboard.kde.org/r/104990/diff/


The major concern should be performance.

Loading a long route (2500 km, 35.000 coordinates), the performance was pretty much identical (~200 ms) for several runs with and without normalization

The startup time for parsing the various files at startup increases slighty from around 1200 ms on my system to around 1300 ms. We might reduce this difference when we remove now unnecessary calls to normalizeLonLat e.g. in GeoDataLatLonBox::fromString. It could even lead to performance improvements later on.

A callgrind log measuring the start, initialization and shutdown of Marble shows that 0.07% of the time (110.000 calls) was spent in normalizeLonLat(). From that 50.000 calls could be spared when removing the normalization in GeoDataLatLonBox::fromString. In summary, the runtime overhead seems to be small.


Dennis Nienhüser

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/marble-devel/attachments/20120519/961a48d1/attachment.html>

More information about the Marble-devel mailing list