@CGsama opened this Issue on August 25th 2018

I use the city db for geoip(php), all fine when using wordwide view. However, it couldn't show on reguion and city map. But correct at realtime map.
5 ac r9qwjo91 un 6d 2o
s37 x s73o3r0 yh5x0xamp
o6a xx h 0_snnmz k4

@sgiehl commented on August 25th 2018 Member

Are you using GeoIP 2 or GeoIP (Legacy)? Our map currently does not support showing regions in all cases for GeoIP 2, as it was not yet updated to support the ISO regions.

@CGsama commented on August 25th 2018

I'm using the GeoIP2(php). Thanks for clarifying that. And for my IP which in Canada, I can see the region map shows correct.

@parruc commented on September 4th 2018 Contributor

Same problem here: for Italy with GeoIP2 (php) I can see the cities correctly but all regions are marked as unknown.

@sgiehl commented on September 6th 2018 Member

For GeoIP2 it will still show regions correctly if the FIPS and ISO code for a region is the same. That applies for US, CA and some smaller countries. We are working on updated maps to fully support the ISO codes GeoIP2 is using...

@mattab commented on March 19th 2019 Member

Since the upgrade to Geoip2, most of countries regions are not displayed correctly in the Maps.
Maybe we should consider disabling the feature of Region mapping on our maps, since it doesn't work mostly -> Moving into the milestone so we can take a decision.

Because It feels bad to have a non working feature it may be easiest to disable region mapping completely

or should we "partially disable region mapping" if it still work for some countries? @sgiehl

@thinkof4 commented on August 9th 2019

Will this bug ever be fixed, I mean this is an one year old issue...

@dfabreguette-ap commented on October 17th 2019

Same bug here ! Any workaround ?
Capture d’écran 2019-10-17 à 09 39 43

@mirkomaty commented on November 13th 2019

@sgiehl, @mattab
What exactly is the problem with fixing this bug? These are the data we get from the maxdb:

{
"city": {
...
}
},
"continent": {
... },
"country": {
"geoname_id": 2921044,
"is_in_european_union": true,
"iso_code": "DE",
"names": {
"de": "Deutschland",
"en": "Germany",
"es": "Alemania",
"fr": "Allemagne",
"ja": "????????",
"pt-BR": "Alemanha",
"ru": "????????",
"zh-CN": "??"
}
},
"location": {
... },
"postal": {
... },
"registered_country": {
... },
"subdivisions": [{
"geoname_id": 2951839,
"iso_code": "BY",
"names": {
"de": "Bayern",
"en": "Bavaria",
"es": "Baviera",
"fr": "Bavière",
"ja": "??????",
"pt-BR": "Baviera",
"ru": "???????",
"zh-CN": "????"
}
}
]
}

As we can see, in subdivisions.iso_code an iso_code is provided. If your maps are based on FIPS codes, all you have to do is to provide a translation based on a file, which can be filled by the community. We are interested in the regions for Germany. The FIPS codes for Germany are

GM01_414_414_state_land_Baden-Wurttemberg__
GM02_414_414_stateland
BayernBavaria
GM03_414_414_state_land_Bremen
GM04_414_414_stateland
Hamburg
GM05_414_414_state_land_Hessen
GM06_414_414_stateland
Niedersachsen
GM07_414_414_state_land_Nordrhein-Westfalen
GM08_414_414_stateland
Rheinland-Pfalz
GM09_414_414_state_land_Saarland
GM10_414_414_stateland
Schleswig-Holstein
GM11_414_414_state_land_Brandenburg
GM12_414_414_stateland
Mecklenburg-Vorpommern
GM13_414_414_state_land_Sachsen
GM14_414_414_stateland
Sachsen-Anhalt
GM15_414_414_state_land_Thuringen
GM16_414_414_stateland
Berlin__

All we need is a file with entries like

GM02 BY

or

GM02_414_414_state_land_BayernBavaria BY

whatever format your map expects. The task for a workaround is to provide an iso code and get a FIPS code.

If you gave me a hint, where I can find the map code I could try to provide that workaround.

That's what we can do now in V3 and an iso based solution can be done without haste for V4.

@sgiehl commented on November 13th 2019 Member

The problem is, that there is no exact mapping from ISO to FIPS code.
You can find a mapping from FIPS to ISO here: https://github.com/matomo-org/matomo/blob/3.x-dev/plugins/GeoIp2/data/regionMapping.php

But it's not possible to invert the mapping for most of the countries. But it should be possible for Germany

@sgiehl commented on December 9th 2019 Member

Most regions should be shown correctly again with next release.
Closing this one in favor of #11929, as new maps should fix that finally

This Issue was closed on December 9th 2019
Powered by GitHub Issue Mirror