Mismatch in parsed GeoDataDocument and GeoSceneGeodata in MarbleModelPrivate::assignFillColors(const QString &filePath)
Closed, ResolvedPublic

Description

In method MarbleModelPrivate::assignFillColors(const QString &filePath):

If the inner loop, which is iterating over the GeoSceneGeodata set in a layer, finds valid GeoSceneGeodata in the layer, the variable data becomes nonnull. If the data is nonnull, it causes the outer loop to exit even when the source file of GeoSceneData and path of parsed file don't match ( the condition data->sourceFile() == filePath in inner loop ). This results in applying wrong GeoSceneGeodata to a GeoDataDocument.

abhgangwar renamed this task from Mismatch in parsed GeoData and GeoSceneData in MarbleModelPrivate::assignFillColors(const QString &filePath) to Mismatch in parsed GeoDataDocument and GeoSceneGeodata in MarbleModelPrivate::assignFillColors(const QString &filePath).Apr 11 2017, 7:24 AM

Can this be reproduced easily? What's the effect?

@shentey Any chance this is related to your latest refactoring in that area of the code?

Suppose the method MarbleModelPrivate::assignFillColors(const QString &filePath) was called when the parsing for the file naturalearth/ne_50m_admin_0_countries.pn2 was done.

Expected Result:
The GeoSceneGeodata for the file naturalearth/ne_50m_admin_0_countries.pn2 , as parsed from the dgml file, contains colors for forming inline styles for each placemark in GeoDataDocument. These inline styles help in coloring countries on map with different colors ( in political map ).
So, in order to see the countries on map, the GeoSceneGeodata for the file naturalearth/ne_50m_admin_0_countries.pn2 should be applied on GeoDataDocument parsed from the same file.

Actual Result:
GeoSceneGeodata for the data file naturalearth/ne_50m_rivers_lake_centerlines.pn2 is being applied on GeoDataDocument parsed from data file naturalearth/ne_50m_admin_0_countries.pn2 due to the reason mentioned in the task description.

Also, the method MarbleModelPrivate::assignFillColors(...) is used to assign inline style to each placemark OR to update the style of a already parsed data so that we don't have to parse the data again. A call to MarbleModelPrivate::assignFillColors(...) is done from MarbleModel::setMapTheme(...) to update the style of a GeoDataDocument.
So, if two themes have some common data, then while switching from one to another, we don't parse the data file again. We just update the style info of the already parsed file.
In case of assigning inline style to each placemark, this method is specific to political map. However, it's also used for others themes in case they have any common data