Limitation of Region Maps

Hello Kibana team,

I am a big fan of your work. I have a geo related question or perhaps ER if you think so. I have followed the steps in the region maps blog and documentation below successfully in the past. For my next task though I do not see a solution with the current capabilities of region maps.


https://www.elastic.co/guide/en/kibana/current/settings.html#regionmap-settings

Specifically, I would like to have all USA counties as a region map in Kibana. As recommended in the blog, high quality data sources like: https://exploratory.io/map provide provide this information in geojson. However, region maps require one key to perform joins of each region in the geojson map with a document in elasticsearch.

regionmap.layers[].fields[].name:
Mandatory. This value is used to do an inner-join between the document stored in Elasticsearch and the geojson file. e.g. if the field in the geojson is called Location and has city names, there must be a field in Elasticsearch that holds the same values that Kibana can then use to lookup for the geoshape data.

The challenge is, county name is not unique. There are several states having the same county. Instead state name and county name or state FIPS and county FIPS are unique. With the current capabilities of region maps and Kibana do you think this task is achievable?

grep NAME county.geojson |sort |uniq -c|sort -nr
31 "NAME": "Washington",
26 "NAME": "Jefferson",
26 "NAME": "Franklin",
24 "NAME": "Lincoln",
24 "NAME": "Jackson",

Here is a full entry from the county-level geojson file:

{
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[-85.8444, 30.7031],
[-85.8261, 30.7253],
...
[-85.8444, 30.7031]
]
]
},
"properties": {
"STATEFP": "12",
"COUNTYFP": "133",
"COUNTYNS": "00295762",
"AFFGEOID": "0500000US12133",
"GEOID": "12133",
"NAME": "Washington",
"LSAD": "06",
"ALAND": 1509528105,
"AWATER": 85786032,
"rmapshaperid": 41
},
"id": 41
},

Thank you in advance,
George Zoto

@thomasneirynck any inputs?

hi @georgezoto,

I'm not 100% familiar with the domain, but I think you can probably use ANSI-codes to uniquely identify a county. more info here: https://www.census.gov/geo/reference/ansi.html

You can also use a scripted-field in Kibana to concatenate two fields. However, this does mean you would have to concatenate these fields in your json file too. https://www.elastic.co/guide/en/kibana/current/scripted-fields.html.

I do agree this is a fundamental limitation (need single field to join), so feel free to open an enhancement ticket as well.

1 Like

Thank you @thomasneirynck, this is what I as thinking as well. True, each county has a unique FIPS code so I either have to enrich my documents with this code or concatenate state and county both in scripted field and the geojson file (error prone). I also created an ER at: https://github.com/elastic/kibana/issues/17115

Loved the layered maps demo at Elasticon by the way, it's exactly what I was looking for in another ER.

Thank you,
George

1 Like

yes I know the ticket :slight_smile: . I'm going to tease yours out in separate ERs, since it contains a lot of separate improvements. Will keep you posted

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