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


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?


{"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...

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.

  "area_code" : "11",
  "sigla": "SP",
  "phone": "11-...",

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