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.
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.
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.
Same problem here: for Italy with GeoIP2 (php) I can see the cities correctly but all regions are marked as unknown.
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...
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
Will this bug ever be fixed, I mean this is an one year old issue...
@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_statelandBayernBavaria
GM03_414_414_state_land_Bremen
GM04_414_414_statelandHamburg
GM05_414_414_state_land_Hessen
GM06_414_414_statelandNiedersachsen
GM07_414_414_state_land_Nordrhein-Westfalen
GM08_414_414_statelandRheinland-Pfalz
GM09_414_414_state_land_Saarland
GM10_414_414_statelandSchleswig-Holstein
GM11_414_414_state_land_Brandenburg
GM12_414_414_statelandMecklenburg-Vorpommern
GM13_414_414_state_land_Sachsen
GM14_414_414_statelandSachsen-Anhalt
GM15_414_414_state_land_Thuringen
GM16_414_414_statelandBerlin__
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.
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
Most regions should be shown correctly again with next release.
Closing this one in favor of #11929, as new maps should fix that finally