Yuppy, SHP format is rendered properly!

The last week was pretty full of Marble for me, and my main two targets were to implement the last (and best 🙂 ) version of Douglas-Peucker filtering and to solve the Antarctica bug.

Douglas-Peucker works as expected, so the creation of the cache happens only once, right after opening the .KML file and lasts somewhere around 3 seconds for that Appalachian Trail line string. Zooming in, moving around the map and all these frequent operations take less than 4ms for detail levels <= 12. After 12, the times increase a little, but they are still better than for the non-filtered version.

Now, about the Antarctica bug: it was by far the hardest task I had to do for Marble until now, because, as the name says, it was a bug fix. And you never know what to expect from bug fixes. The problem was this: in the Spherical Projection, a linestring that contained Antarctica ( the most important properties of this linestring are that it is closed, that it contains the pole and that it intersects the dateline ) was rendered properly, but in the Cylindrical Projections it looked like this ( obviously wrong ):

The thing I was suggested to try was to find the southernmost dateline crossing of the linestring, and insert between those two points two another points, (-180, -90) and (180, 90), which should create the link and close the polygon properly. After adding the necessary features to the GeoDataLineString and inserting the points in AbstractProjection::crossDateLine, I had to try different ways for more than 4 days, because Antarctica didn’t seem to want to work. After noticing that those wrongly drawn points were actually not random, but points translated 360 degrees to the left / right from their correct position, I played a bit with the normalizations and managed to make the map look right:

As I am getting to the heart of my project, I received a bonus today, after trying to load the first SHP files:

They work and it looks like Antarctica is rendered properly!!! Yuppy! 🙂

[Later Edit]: Last night, SHP rendering didn’t work with linestring filtering, but now it does 🙂 A toast for a faster Marble! 😀

This entry was posted in Uncategorized. Bookmark the permalink.

8 Responses to Yuppy, SHP format is rendered properly!

  1. Awesome work, dude – I really look forward to a faster rendering. Currently, on full-screen on my laptop, it\’s quite slow – and even more so on my mobile. And rendering is what GPU\’s are for, so it should make better use of the available resources, too.

    • Hey Jos, the changes we make to the 2D engine will certainly make things faster. But they won’t make slow 2D graphics drivers magically super-speedy.
      So maybe you should cheer for Bernhard – he is working on the OpenGL 3D mode for Marble during GSoC. That one might provide better speed if the OpenGL drivers work well for you.
      Pick your poison 😉

  2. Don Cornelius says:

    The shape looks good but don’t you think the size of Antarctica is just a… tad too huge in that projection? Unless the projection is intentionally distorted towards the south pole, but then why are South America and Australia still so tiny? New Zealand should be huge too. Wouldn’t a true cylindrical projection distort the size of the North polar region just as much?

  3. John Layt says:

    Fantastic to see the progress you are making 🙂 After years of dreaming of getting this done it’s great to see it all coming together at last!


  4. mocancezar says:

    Thanks, I’m glad you enjoy it and I hope it’ll work as we plan 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s