Bye bye Plain Map

Hello again Marble fans! As August approaches, the process of replacing the Atlas map is progressing and producing pretty good results. Last time I posted, I managed to open SHP ย and make them work with filtering. Right now, Marble has a fully functional Topographic Map (same as the old Plain Map, just that vector layers are replaced with geodata layers).

The first step needed in order to get here was to create a new DGML file, for the new Topographic map, that loads the SHP and KML files which create the map. After this, i had to manually create an Ocean Layer, for making the Earth blue, since the old map had one of its own. After following these steps the Earth looked… a little bit pink ๐Ÿ™‚ (the colors are hardcoded for now, since SHP files do not define colors and styles, as KML’s do)


Back to serious business ๐Ÿ™‚ Brush applied, same color as Plain Map, but still hardcoded.ย 

Now, for recreating the functionality of the DGML vector style, I had to make the pen and the brush customizable from the DGML file (meaning that the colors of the map can be set from the DGML, using tags, with nothing to change in the code). The basic principle of this action was to take the penStyle and brushStyle obtained by the DGML parsers and assign them to the GeoDataDocuments created from parsing the SHP maps, and I had to deal a lot with four files: MarbleMap.cpp, MarbleModel.cpp, FileManager.cpp and FileLoader.cpp. Briefly, I obtained the style defined in the DGML file inside MarbleModel.cpp and transmitted it up to FileLoader.cpp, where I applied it to the documents. Here’s how the map looks right now (with colors and pen styles customizable yay ๐Ÿ™‚ ):

Still, we’ll have to deal with a bug, coming from the SHP parser I believe. If you look carefully in the map below, parts of some border lines do not get displayed… Any ideas why? ๐Ÿ™‚

Next, I have to add the Texture Layers to this map and say bye-bye to the old Atlas Map too ๐Ÿ™‚

This entry was posted in Uncategorized. Bookmark the permalink.

4 Responses to Bye bye Plain Map

  1. Tondu says:

    The borders seem to be missing at the position of the Caspian See, which is for some reason missing on the rendering.

  2. mocancezar says:

    The borders are missing in other places too (look at the Spain-France border for example, the southernmost part isn’t there…). If I remember well, the Caspian Sea is located in the lakes SHP map, which is not yet loaded on the map. It’ll be there shortly ๐Ÿ™‚

  3. gisthoughts says:

    the .shp file format requires only .shp, .shx, .dbf and optionally .prj. The cached files .sbn and .sbx cause all sorts of problems, delete them from time to time, and your problem will go away.

  4. mocancezar says:

    Thanks for the tip ๐Ÿ™‚ I tried removing the .sbn and .sbx, but the problem persists…

Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s