[Marble-devel] Re: Marble Sprint (Nov. 5-7): Hotel booking

Torsten Rahn tackat at t-online.de
Sat Oct 9 15:45:07 CEST 2010


Hi John,

Am Samstag, 9. Oktober 2010 13:08:01 schrieb John Layt:
> On Tuesday 05 October 2010 08:12:48 Torsten Rahn wrote:
> > Hi John,
> > 
> > Am Montag, 4. Oktober 2010 23:11:49 schrieb John Layt:
> All booked in and looking forward to being there :-)  Now to get on with
> the homework!

Great :-)
 
> I've been looking around for more up-to-date and useful country borders to
> replace mwdbii and think I've find a good free one at
> http://www.naturalearthdata.com/features/, 

Yes, if you look into the Marble Sprint wiki you might see that I had made 
Natural Earth Data a topic already. While I hadn't thought of this particular 
use case your suggestion nicely complements the topics I would have suggested 
:-)

> but that would depend on
> Shapefile support.  Something to think about anyway.

Yes, Shapefile support has been requested by a few people already. And you 
might want to get in touch with Thibault Gridel to get the interfacing done 
properly.

However there are a few catches with this approach of adding vector data:

The current mwdbii data with it's supersimplistic format has several important 
advantages (which you're probably still aware of since your investigations 
during Kartographer time):

* It already comes with a detail property for each node. This allows us to 
quickly render the polylines since high-detail-nodes can be skipped quickly. 
* It uses up mininmal space in the file since it only stores two coordinates 
and the detail attribute, each of the three values in a short. This allows us 
to ship a quite highly detailed vector map without 

Of course we don't want to make marble slower and we still want to ship some 
vector data with Marble. 
So we need to investigate whether there's a way to get using shapefiles and 
have the same advantages.

The following solutions come to my mind:

1.) We convert the shapefiles to PNT (and do the detail levels via usage of 
the Douglas-Peucker Polygon algorithm). We'd basically end up with the same 
approach but updated country borders.

2.) We package shapefiles with Marble which have a good ratio between detail 
and space (I'd still like to keep the Marble install package around 15-25 MB, 
so you do the math ;-) :

Looking at the Natural Earth data I see that basically there are three levels 
offered: 10, 50 and 110. Maybe we can ship the  coarse level (110 or 50) 
prepackaged with Marble and automatically download the higher levels in the 
background.

There's another catch with the second solution: One of Marble's benefits is 
that it doesn't have any dependencies apart from Qt. Now as long as shape file 
support would stay optional I wouldn't mind linking against e.g. libshape. 
However if we rely on it to display basic vector data like countries, etc. 
then this dependency would not be optional anymore. And therefore a hard 
dependency on libshape wouldn't be an option.

From what I recall at least the polygon parsing (without the database aspect) 
for shape files is quite "easy" to reimplement. So somebody would need to 
reimplement shapefile parsing (or at least find some properly licensed code 
(ideally PD, BSD or at least LGPL)  that we can integrate with Marble in order 
to parse the files.

Another catch with the second solution is tackling the amount of detail: I 
don't know whether shapefiles provide detail levels for nodes. If they don't 
then we might consider enhancing our GeoDataLineString class to internally 
apply the Douglas-Peucker algorithm automatically and cache the result (there 
is PD licensed code for it available somewhere, so adding it shouldn't be too 
hard). 

We also had the idea of having Quad-Tile layouted vector files (like with the 
raster data). But this would be even more complicated to add (Since we'd rely 
on even more stuff from the GeoGraphicsView that hasn't been implemented yet). 
So I leave this out for a moment.



Best Regards,
Torsten





 
> Cheers!
> 
> John.
> _______________________________________________
> Marble-devel mailing list
> Marble-devel at kde.org
> https://mail.kde.org/mailman/listinfo/marble-devel



More information about the Marble-devel mailing list