matomo-org / matomo

Empowering People Ethically with the leading open source alternative to Google Analytics that gives you full control over your data. Matomo lets you easily collect data from websites & apps and visualise this data and extract insights. Privacy is built-in. Liberating Web Analytics. Star us on Github? +1. And we love Pull Requests!
https://matomo.org/
GNU General Public License v3.0
19.36k stars 2.59k forks source link

Updated / New Matomo Maps #11929

Open sgiehl opened 6 years ago

sgiehl commented 6 years ago

Our map wasn't updated for some years and some stuff is shown wrong or is incomplete. Unfortunately our map generator (https://github.com/piwik/piwik-map-generator) is outdated and doesn't work anymore.

We either should try to get the old generator working again or look out for some completely new maps.

Would be awesome if we would find some volunteer for this project, as we currently have more important issues and won't be able to handle this soon.

Summary of Issues that should be resolved with new maps:

11266, #10963, #10123, #9719, #9170, #321, #13347, #18459 and maybe others

fengkaijia commented 6 years ago

Adding to the issue board: Hong Kong and Macao are missing from the map (not in either World/Asia/China view). I guess the same goes to a few European city-size country/regions as well, e.g. the Holy See. How about moving to Highmaps (and add an option to allow non-commercial users to switch to it).

mattab commented 6 years ago

How about moving to Highmaps (and add an option to allow non-commercial users to switch to it).

Their license is not compatible with the GNU/GPL so we can't use it

tassoman commented 4 years ago

I dunno if you're interested but why overhelming the project with map building (going outside the matter of analytics) while there are already good mapping projects outta there?

I mean can be interesting having a ready made map based on leaflet.js filled with OpenStreetMap open data, or maybe a d3-geo based project?

Findus23 commented 4 years ago

@tassoman I don't know any specifics yet, but using one of those is pretty much what is planned.

tsteur commented 4 years ago

@tassoman yes 99% likely we will use some existing solution as building a maps is a project in itself which we don't want to do. Better for us to focus on analytics :)

There is also https://github.com/markmarkoh/datamaps (based on d3 though) and https://github.com/10bestdesign/jqvmap and a few other ones.

mattab commented 4 years ago

Suggested next step: research for maybe 1 or 2 days and trying quickly whether any of the libs above could work for us.

fengkaijia commented 4 years ago

ECharts (https://github.com/apache/incubator-echarts) might also work, it reads GeoJSON and provides a built-in world map.

For provincial level maps, we still need to generate the GeoJSON by ourselves, from sources like shapefiles, such as naturalearthdata.com. You may refer to some examples with ECharts from https://github.com/echarts-maps/echarts-countries-js.

Findus23 commented 4 years ago

ECharts looks like a huge charting library that can also do geoplots. Maybe we should go for something simpler.

My idea would be -> Downloading shapefiles from naturalearthdata.com -> writing a nodejs script that converts it to geojson -> I would recommend to use topojson as it is an extension of geojson specifically for map borders. It is able to unify borders between area and takes less space and most importantly allows to simplify the border shape while still keeping the topology intact (so no gaps between countries due to rounding). I'm doing something similar (but simpler) here where I store parking district areas. Topojson can be very simply converted back to geojson on the frontend. https://medium.com/@mbostock/command-line-cartography-part-1-897aa8f8ca2c is a bit old but a good guide for all of this. mapshaper also allows to do multiple of these steps in one tool, so it is worth looking at For displaying the map I think we have two different directions we could go with creating the map.

Either stay with stylized simple maps, render them e.g. with d3 similar to http://bl.ocks.org/michellechandra/0b2ce4923dc9b5809922. This would probably allows a quite quick and responsive interface and nice visualizations (as the countries are just SVG shapes again and can be styled easily). But we would probably just like now have fixed views of continents, countries, etc.

Or we go the leaflet route. This would mean that we have one map where one could zoom and pan freely, clicks on countries could zoom in on them. This would allow more posibilties (like simply adding more map layers with "real' maps. But it would also take more resources (my map has quite few lines on it, but is already not that fluid) and possibly be less responsive.

http://bl.ocks.org/mpmckenna8/af23032b41f0ea1212563b523e859228 is a great demo for this.

Personally I'd go with the first method as I think it will be the nicer user experience for Matomo users (simple county maps could load very quickly into a small svg and not need slow initializing of whole map rendering which allows them to be shown in more places in Matomo), but the second method might be easier to program and is what I have more experience with.

sgiehl commented 2 years ago

@justinvelluppillai might be good to think about giving this one a higher priority at some point, as our maps are really outdated meanwhile and there are more and more issues coming in over time...

varunKothare commented 1 year ago

Further updates on a this topic has been added in the comments here: https://github.com/matomo-org/matomo/issues/12507 Regarding how the Indian Map is being represented.

sgiehl commented 1 year ago

@mattab This issue might need a higher priority at some point. It might be acceptable for an open source project to contain very very outdated map data. But as a company serving customers that might be less acceptable. At some point we might need to consider disabling / removing the map widgets maybe as it's better not to have a feature, than having a outdated map causing more and more displeasure

tassoman commented 1 year ago

I want to add a note to my previous comment about OpenStreetMap isn't very well suitable because "official" servers are set in USA and maybe a privacy constraint for certain users.

I'd rather be for a local vectorial library. Maybe the Vue Echarts v3 library, but it's based on Vue2 https://github.com/xlsdg/vue-echarts-v3

https://xlsdg.org/vue-echarts-v3-demo/#/demo02

MatomoForumNotifications commented 1 year ago

This issue has been mentioned on Matomo forums. There might be relevant details there:

https://forum.matomo.org/t/how-to-add-andorra-or-monaco-in-visitors-map-or-filter/49548/2

MatomoForumNotifications commented 1 year ago

This issue has been mentioned on Matomo forums. There might be relevant details there:

https://forum.matomo.org/t/some-french-regions-are-not-defined/50483/3

MatomoForumNotifications commented 10 months ago

This issue has been mentioned on Matomo forums. There might be relevant details there:

https://forum.matomo.org/t/probleme-de-geolocalisation-et-statistiques-absentes/53255/2

9joshua commented 4 months ago

A Cloud customer is experiencing the same region mapping issue for Norway mentioned in https://github.com/matomo-org/matomo/issues/20368 Visits to the majority of regions in the country table do not appear/exist on the map.