-
Notifications
You must be signed in to change notification settings - Fork 8
[WIP] Make map-generator working again #1
[WIP] Make map-generator working again #1
Conversation
Had a short look. Seems the map generator didn't generate the same amount of maps... some are missing in the archive. Also Piwik seems not be able to handle the new maps. Needs some further investigation |
The iso-data-attribute in the continent maps was wrong ( Still up the check if countries are correct... |
the world map wasn't included in the archive as well. Guess that needs to be activated here: https://github.com/piwik/piwik-map-generator/blob/master/make-maps.py#L38 |
World map should now be generated properly with the new datasets. At least it gets displayed and colored. Country maps seem to not receive their attributes properly. They should have the necessary information (fips, fisp-, iso3, name, p) but at least France does not use them. The old maps triggered a data reload and the new ones don't... |
There are still some maps missing after running the generator. Seems those fail with the message |
Custom bounding boxes and patching around in the kartograph code allowed me to circumvent the Patch for the --- /usr/local/lib/python2.7/dist-packages/kartograph/renderer/svg.py 2017-08-07 18:49:15.881927526 +0000
+++ /usr/local/lib/python2.7/dist-packages/kartograph/renderer/svg.py 2017-08-07 18:48:55.841927406 +0000
@@ -96,10 +96,13 @@
return node
def _render_geometry(self, geometry):
- from shapely.geometry import Polygon, MultiPolygon, LineString, MultiLineString, Point
+ from shapely.geometry import Polygon, MultiPolygon, LineString, MultiLineString, Point, GeometryCollection
if geometry is None:
return
- if isinstance(geometry, (Polygon, MultiPolygon)):
+
+ if isinstance(geometry, (GeometryCollection)):
+ return
+ elif isinstance(geometry, (Polygon, MultiPolygon)):
return self._render_polygon(geometry)
elif isinstance(geometry, (LineString, MultiLineString)):
return self._render_line(geometry) I don't think there is a solution to the missing maps without patching |
Country maps are now clickable and properly load their data. Messed up the ISO data on the context layer... |
As unhappy as I am to admit that I don't think I can get this to fully work. There are just some maps that (at least to my knowledge) I can't generate without patches to I have dabbled around with the successor library The problem here:
Personally I think this generator here could be used to generate a final set of maps. However every map would require manual checking in the UI to verify it is not broken and "fits into the world" (some countries are not generated and some are new). Afterwards it would be best to find a new solution for the maps... |
@mneudert Could you generate such a set of maps and create a PR for piwik with it? |
Generating the maps is no problem. Is there a simple way to generate at least one user for each possible region on the map to have everything nice and clickable to find the broken parts? |
Not yet, but might be worth to implement in VisitorGenerator plugin |
I did take a look at the current status of the new maps to check if I can help, but I think the best solution is doing something completely else: The great work of @mneudert shows that with hacking around it would be possible to get this repo back to running and create mostly working maps again. But most of this isn't needed anymore. As Gregor mentions in the README files of both repos, in the last 6 years many things changed and now there are many great alternatives: @gka, what do you think is the best way to go about updating the maps in Matomo? |
@Findus23 Likely we are going to build the maps completely new. Hope to be able to give a first preview or an update in a few weeks or so. |
@mneudert @sgiehl @Findus23 i will close this PR for now. When it becomes a priority again we can look at it and reopen if needed. There are also some alternatives that could be interesting for us and support various features we need incl zoom levels etc. eg |
After a somewhat painful installation process of all required dependencies I managed to hack around enough to generate some maps:
https://gofile.io/?c=zQS7uf
Besides the changed remote archives and extracted files (@sgiehl seems to have a good looking fix in his fork) the data files itself seem to have changed quite a bit. Like the "ISO" field not always being available. Or missing "FIPS" data...
At the moment the "fix" is a total mess and I still need to check if the resulting files are actually usable in Piwik itself. The missing attributes (e.g. "data-fips") should be injectable by grabbing them from the existing files if the ISO codes are inserted correctly.
Not nice but perhaps it gets to a usable state until a better solution is available.