Using custom region map

Hi,
I'm trying to use a custom region map. I've created one and imported so it looks like this:


Identifier is the district name.

Then I prepare a query that gets average number for each district:
image

And then I try to show it as a region map:

But the map shows only one district:

I tried to run this query:

select district,count(*) from `offers` group by district order by district

from mysql shell and go strange result:
image
image
but if I run same query in metabase I get it normal:
image
image
Last record is the only one, which is shown on the map.

I will of course dig into MySQL side too. But if metabase shows it correctly as a table why doesn't it show on a map?

Hi @ralfeus
Which version of Metabase? Please post “Diagnostic Info” from Admin > Troubleshooting.
My first guess - it’s something to do with incorrect charset/encoding somewhere, since you’re even getting funky results directly from shell.
Make sure that you’re using utf8mb4 on your MySQL database/table/column, and the GeoJSON needs to be utf8.

Here it is:

{
  "browser-info": {
    "language": "cs",
    "platform": "Win32",
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:73.0) Gecko/20100101 Firefox/73.0",
    "vendor": ""
  },
  "system-info": {
    "java.runtime.name": "OpenJDK Runtime Environment",
    "java.runtime.version": "11.0.5+10",
    "java.vendor": "AdoptOpenJDK",
    "java.vendor.url": "https://adoptopenjdk.net/",
    "java.version": "11.0.5",
    "java.vm.name": "OpenJDK 64-Bit Server VM",
    "java.vm.version": "11.0.5+10",
    "os.name": "Linux",
    "os.version": "4.15.0-74-generic",
    "user.language": "en",
    "user.timezone": "GMT"
  },
  "metabase-info": {
    "databases": [
      "mongo",
      "mysql"
    ],
    "hosting-env": "unknown",
    "application-database": "h2",
    "application-database-details": {
      "database": {
        "name": "H2",
        "version": "1.4.197 (2018-03-18)"
      },
      "jdbc-driver": {
        "name": "H2 JDBC Driver",
        "version": "1.4.197 (2018-03-18)"
      }
    },
    "run-mode": "prod",
    "version": {
      "date": "2020-02-25",
      "tag": "v0.34.3",
      "branch": "release-0.34.x",
      "hash": "1a83edb"
    },
    "settings": {
      "report-timezone": null
    }
  }
}

I have re-imported data to MySQL so it looks right now and that fixed the problem with metabase too.

1 Like

@ralfeus Excellent. Please remember to move away H2 before going into production:
https://www.metabase.com/docs/latest/operations-guide/migrating-from-h2.html