Region Map does not show

Hi!
I'm playing with my own German region maps.
I got a geojson file with the following format:
{"type":"FeatureCollection","features":[
{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[...]]]},"properties":{"plz":"01067","note":"01067 Dresden","qkm":6.866412,"einwohner":11957}},
I registered it in kibana.yml with the little trick of kibana server self hosting:
regionmap:
layers:
- name: "Deutschland"
url: "../plugins/mm_geo/plz-5stellig.geojson"
fields:
- name: "plz"
description: "zip code"
And I see it in kibana region map definition and can select the given field "zip code". But I still do not get any visual feedback.
The data in Elasticsearch uses this mapping:
put streaming
{
"mappings":{
"exc":{
"properties":{
"id": {"type":"keyword"},
"eventTime":{"type":"date"},
"plz": {"type":"long"}
}
}
}
}

Hi,

the issue is most likely due to a data type mismatch. As you can see in your geojson file, the field is "plz": "01067", so of type string, where as you index it in your mapping as type long. Since German Postleizahls can begin with a 0, you must actually use a string format, since numeric values, won't have the capabilities for any leading zeroes.

So you should change the type to string and reindex the data with the leading zeroes. In that case the mapping should work.

Cheers,
Tim

Thx Tim, I will try using string type.
Should I use type string or keyword?

Sorry, you should use type keyword i.e. a non analyzed string for that field.

Changed mapping to the following:
put streaming
{
"mappings":{
"exc":{
"properties":{
"id": {"type":"keyword"},
"eventTime":{"type":"date"},
"plz": {"type":"keyword"}
}
}
}
}

But still do not get anything displayed.

@thomasneirynck is the above GeoJSON format correct or do you see any other issues?

No warnings or things like that. I see the correct name of the region map in kibana and the correct description of my field.
How can I check the correct format of the geojson file?
I downloaded it from here: https://www.suche-postleitzahl.org/plz-karte-erstellen
If you want to, I can provide the geojson file. Or does elastic provide a zip code geojson file ?

Hi @BicaLuv,

can you double check a couple of things:

  • open the spy panel (little arrow bottom left). Do you see the correct result there? Be sure that the values in the first column exactly match the property-values in your geojson
  • open the browser debugger. is your geojson file correctly served by Kibana? (ie. no errors)

Make sure you keep "display warnings" in the Options-tab checked. It will give you feedback if any rows from your terms-aggregation cannot be joined to the geojson from your Germany file.

spy panel: Yes, I see plz 64291 and count 16. both are right
BUT I get an 404 for the following url: http://localhost:5601/plugins/region_map/data/plz-5stellig.geojson
I thought I can place my geojson file under "/Users/BicaLuv/kibana-6.1.1-darwin-x86_64/plugins" to get it served by kibana server like I read in another post.
Isn't this correct? Do you support file serving/providing go geojson files?

Serving files with Kibana is not recommended as it uses internal implementation details.

There recommend way is to setup your own server, see https://www.elastic.co/blog/custom-region-maps-in-kibana-6-0 for a tutorial.

As for your particular problem. Did you put the file inside a "kibanainstallfolder/core_plugins/region_map/data" folder? It seems from the 404 that Kibana is trying to get the file from that location.

I understand and know that it is not an officially supported way but due to the absence of file serving in kibana, I tried this for a quick test.
I provided the file under "kibanainstallfolder/plugins/region_map/data".
Moving it to the core_plug-ins/region_map/public folder, everything works!

One addition:
When I copy my geojson file to my own web server and change the kibana.yml file accordingly I get the following error while kibana (5.6.x) tries to load my region map:

Uncaught (in promise) Error: Could not retrieve manifest from the tile service: status -1
at ServiceSettings. (kibana.bundle.js?v=15554:262)
at tryCatch (commons.bundle.js?v=15554:52)
at Generator._invoke (commons.bundle.js?v=15554:52)
at Generator.prototype.(anonymous function) [as throw] (http://vxbdlabneo4je01:5611/bundles/commons.bundle.js?v=15554:52:28913)
at step (kibana.bundle.js?v=15554:262)
at kibana.bundle.js?v=15554:262
Promise.then (async)
(anonymous) @ kibana.bundle.js?v=15554:277
$digest @ commons.bundle.js?v=15554:39
$apply @ commons.bundle.js?v=15554:39
(anonymous) @ commons.bundle.js?v=15554:42
dispatch @ commons.bundle.js?v=15554:28
elemData.handle @ commons.bundle.js?v=15554:28

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.