# Configuration of Region Map using Brazil state area code as hash value

**URL:** <https://discuss.elastic.co/t/configuration-of-region-map-using-brazil-state-area-code-as-hash-value/163418>\
**Category:** Kibana\
**Created:** [January 8, 2019, 6:08pm UTC](https://discuss.elastic.co/t/configuration-of-region-map-using-brazil-state-area-code-as-hash-value/163418 "2019-01-08T18:08:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pbressan13](https://avatars.discourse-cdn.com/v4/letter/p/cab0a1/32.png) [@pbressan13](https://discuss.elastic.co/u/pbressan13)\
**Post date:** [January 8, 2019, 6:08pm UTC](https://discuss.elastic.co/t/configuration-of-region-map-using-brazil-state-area-code-as-hash-value/163418/1 "2019-01-08T18:08:02Z")

</div>

Hi,

I'd like to know, if there's a way to use state area code from Brazil to be translated to a geolocation to be shown on Region Map.  
Each register of my data has the phone number, and my idea is to extract the state area code from it.

E.g. Rio de Janeiro from BR has area codes, 21,22 and 24  
São Paulo has area codes 11,12,13,14,15,16,17,18,19

I've created a geojson file, with the coordinates of each state, and used the field "cn" as indicator.  
Am i way too far of getting it or my file is correct, can you tell me which steps am i supposed to do?  
Thanks

E.g:

{"type": "Feature", "properties": {"id":26,"nome":"SÃ£o Paulo","sigla":"SP","regiao\_id":"2","codigo\_ibg":"35","cn":"11"},"geometry": { "type": "MultiPolygon", "coordinates": ... etc...  
{"type": "Feature", "properties": {"id":26,"nome":"SÃ£o Paulo","sigla":"SP","regiao\_id":"2","codigo\_ibg":"35","cn":"12"},"geometry": { "type": "MultiPolygon", "coordinates": etc...

---

<div class="post-metadata">

**Author:** ![nickpeihl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nickpeihl/32/112622_2.png) [@nickpeihl](https://discuss.elastic.co/u/nickpeihl)\
**Post date:** [January 8, 2019, 10:43pm UTC](https://discuss.elastic.co/t/configuration-of-region-map-using-brazil-state-area-code-as-hash-value/163418/2 "2019-01-08T22:43:17Z")

</div>

I would recommend adding one of the state identifiers (sigla, regio\_id, or codigo\_bg) to your documents in Elasticsearch. That way you can have only one feature for each region in the GeoJSON file.

So your document in Elasticsearch may look like this. And in the region maps config you would join on the "sigla" fields.

```auto
{
  ...
  "area_code" : "11",
  "sigla": "SP",
  "phone": "11-...",
  ...
}

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 5, 2019, 10:43pm UTC](https://discuss.elastic.co/t/configuration-of-region-map-using-brazil-state-area-code-as-hash-value/163418/3 "2019-02-05T22:43:22Z")

</div>

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