Map Data

​Maps are created using MapBox.

Map data are pulled down from MapBox.com, but no information is sent to MapBox. Location data in your Microreact project are not shared with MapBox, but rather they are overlaid onto the maps pulled from MapBox.

​​Location data formats

Locations can be encoded via either geographic coordinates (latitude and longitude) or ISO 3166 codes.

By default, Microreact expects columns for latitude and longitude (in positive and negative numbers). As an alternative to coordinates, a single column for ISO 3166 codes can be provided.

Latitude and Longitude

ISO 3166 Codes

For country level codes, any two-letter code from the official 3166-1 list can be used. For the UK and USA, two-letter codes from the the 3166-2 lists can be used.

Note: if you would like to add more lat/long codes for other country 3166-2 codes (or notice an outdated code) please send a pull request for this file (or, if you do not know what a pull request is or cannot send one, submit the request as feedback using the "send feedback" menu in the left sidebar). To expedite your request, include the codes and locations in the format below:

Code in double-quotes followed by a comma
longitude followed by a comma
latitude followed by a comma
location/region name in double-quotes

"BE-VLG",
51.0962462,
4.1786291,
"Flemish Region"

GeoJSON boundaries

In addition to data location data, if a geojson file is imported, then a chloropleth will be rendered on the map. Adding a GeoJSON file to your Microreact project is the only way to create a chloropleth on your map. The colour will be based on an aggregate of the number of IDs within each geoJSON boundary.

Sourcing a GeoJSON file

GeoJSON files are shape files in a specific format. The internet has vast amounts of boundary shape data. There are also sites for converting files from one format to another, so you can create a GeoJSON from another shape file format.

Search online for files containing the type of boundary and geographic area you need. Helpful search terms: geojson, shapefile, country polygons, administrative boundaries, regional borders, cartographic boundary

Here are a few ideas (WARNING: CGPS cannot confirm safety or correctness of data from these sites)

Troubleshooting

If your map shows points in an unexpected place, you will need to fix your latitudes & longitudes. There are two main reasons records show in the wrong place.

Lacking a minus sign for S/W coordinates

Ambiguous Geocoding determined lat/long

If you are using Data-flo or another method of geocoding to determine the latitude and longitude, ambiguities like these might be causing misinterpretation of your locations:

  • Manchester is a city in England and also a city in New Hampshire, USA

  • 15220 is a postcode for Vitrac France and also for Pittsburgh, PA USA

  • Washington is the name of one US State, one US District, 21 US Cities, and 30 US Counties

Last updated