-
Notifications
You must be signed in to change notification settings - Fork 45
Map View with GeoJSON Files and Custom Maps
⚠️ Feature in development: This feature is in development and is not yet available on the main MicrobeTrace site.
GeoJSON Files and custom maps support three types of tasks:
- Add latitude and longitude coordinates to existing nodes.
- Add addtional geographic data to an existing map or as a standalone map.
- Replace a map with an image, such as a floorplan, and place nodes on it.
Use this workflow when a GeoJSON file contains locations for nodes that are already in MicrobeTrace.
- Each GeoJSON feature must have an ID that matches an existing node ID.
- Coordinates must use GeoJSON order:
[longitude, latitude]. - The GeoJSON file adds locations to existing nodes; it does not create new nodes.
- Open the Files tab.
- Add the GeoJSON file along with your node data.
- Confirm that the file type is GeoJSON.
- In the GeoJSON file's ID selector, choose the property that matches the node IDs.
- Select Launch for a new dataset or Update if the dataset is already open.
- Open Map View.
For each match, MicrobeTrace adds GeoJSON Latitude, GeoJSON Longitude, and GeoJSON Feature ID to the node. It also selects the new latitude and longitude fields for Map View.
The example example_node_locations.geojson works with the preloaded dataset.

If nodes do not move, confirm that the selected GeoJSON ID property exactly matches the node IDs.
Use this workflow when you want to display and/or higlight GeoJSON elements such as state, county, campus, or building boundaries. Uploading GeoJSON here displays it as a map but does not add its properties or coordinates to nodes.
(https://github.com/CDCgov/MicrobeTrace/blob/dev/examples/example_files/selected_states.geojson?short_path=eeab830) Download Example File
Download Example File 2 Download Example File 3 Download Example File 4 Download Example File 5 MicrobeTrace/dev/examples/example_files/selected_states.geojson
- Load your data and open Map View.
- Open Settings > Custom Map.
- Under Background, select a
.geojsonor.jsonfile. - Choose how to display the Layer:
- Show displays the custom map by itself and hides the standard map layers.
- Overlay displays the custom map over the selected basemap or other standard map layer.
- Hide temporarily hides the custom map without removing it.
- Select Center to fit the custom map and nodes on the screen.
You can also change the GeoJSON Color, Transparency, and Labels in the same settings panel.
This use case can be used to highlight specific regions, add additional map boundary (such as state boundaries for Brazil), or add additionally geographic data (such as New York Subway System) to the map.
Use this workflow to place nodes on a non-geographic image such as a floorplan, seating chart, or diagram. Common supported formats include .png, .jpg, .jpeg, .gif, .webp, and .svg.
If you want MicrobeTrace to place groups of nodes into labeled areas, first add a field containing the area name for each node, for example, Room. For your own dataset, this field can just be added to the node list.
The example COVID-19_simulated_testFloorplan.csv adds room numbers to nodes in the preloaded dataset. Add it on the Files tab and select Update before opening Map View.
- Open Map View > Settings > Custom Map.
- Under Background, select an image. For example, use
example_floorPlan.png. - Set Layer to Show.
- Select Center.
You can now place nodes with room boundaries, manual positioning, or both.
This is the quickest method when multiple nodes share a room or other labeled area.
- Under Boundary Labels, set Node Field to the field containing the room or area names. For the example data, select
Room. - Select Polygon or Freehand, then draw the boundary of one room on the image.
- Enter a label that matches a value in the selected node field, such as
1-101. - Select Save.
- Repeat for the remaining rooms.
MicrobeTrace places each matching node within its labeled boundary. The Status line shows how many nodes are matched and unmatched.
Use this method to choose the exact position of individual nodes.
- Under Manual Positions, set Positioning to On.
- Choose a node from the Node dropdown.
- Select the desired location on the image.
- Select Next Unplaced and repeat as needed.
You can also drag a placed node to move it. A manual position takes priority over a position created from a room boundary.
- Clear removes the current custom map. For an image, it also removes its saved boundaries and boundary-generated positions.
- Clear Selected removes the selected node's manual position.
- Clear All removes all manual positions for currently visible nodes.
- Reposition All assigns new positions within the saved boundaries.
- Saving the session as a
.microbetracefile preserves the custom map, boundaries, and node positions.
- A GeoJSON feature did not match a node: Check the ID property selected on the Files tab and confirm that its values exactly match the node IDs.
- Nodes do not appear on a GeoJSON map: Confirm that the nodes have valid latitude and longitude values.
- Nodes do not appear on a floorplan: Confirm that the layer is set to Show and either define matching room boundaries or place the nodes manually.
- A room has unmatched nodes: Confirm that the boundary label matches the node field value. Matching ignores capitalization and spaces at the beginning or end.
Copyright 2017-2020 Centers for Disease Control and Prevention • Acknowledgements


