Getting Started with Maps

Getting started with maps

    • Note: The Four Elephant Seals CODAP example document shown in the video above can be found here.
    • Display a map. Click the map icon on the top toolbar. If a table within CODAP contains mapping data (columns labeled as longitude and latitude), a map of the corresponding points will be displayed automatically. Note: there has to be one column labeled longitude and another column labeled latitude for the map to display properly--using other names for these columns will lead to the map not displaying the cases (lat and lon or long also work as shorthands for latitude and longitude).
    • If the table does not contain mapping data, a Google API map opens, without CODAP data.
    • Toggle between map styles (Oceans, Topo, or Streets) using the buttons in the map's upper right corner.
If latitude and longitude data are included in a data set, CODAP can plot the data points on a map.  Drop an attribute (column header)  from the table on the map to view the data mapped for that attribute. To view data by frequency, click on the ruler icon to the right of the map, and select “Show grid.”
  • View data by frequency. Click on the ruler icon in the inspector panel to the right of the map. Then, select the “Show Grid” tool from the ruler menu to view data on the maps in coarse-grained bins. Use the slider displayed during grid view to adjust the size of the grid cells and discover new patterns.
  • Note: Deselect “Points” from the ruler menu item to focus solely on the grid view.
  • Drag and drop an attribute from a table onto the map to view mapped data for that attribute. This will color the points by that attribute. For categorical attributes, the points corresponding to each distinct category will get a distinct color, as shown on the map's legend. You can learn about how coloring works for numeric attributes here.
  • To adjust the map's center point drag on the map. Click the dotted square at the map's upper right to enable a selection crosshairs. Click on the eye icon in the inspector panel to the right of the map to hide or view only the selected cases. 
  • Zoom in or out on the map by clicking the + or - sign in the top left corner.
  • To select multiple points on the map click on the dotted square in the upper right corner (the marquee tool) and drag across the points you wish to select. Note that cases selected on map are also selected/highlighted in any tables or graphs you have open. (Also, selecting cases in a table or graph that is open will also select them on the map.) To deselect points on a map, click on any spot on the map that is not a point. You can also select multiple points on a map by holding down the Shift key, the Command key (on Macs), or the Windows key (on Windows) and clicking on each point that individually that you wish to select. Or, if you have added an attribute to your map, you can click on a color in the legend to select the points with those values on the map.

Maps with Boundaries

If a CODAP document contains map boundary data, CODAP will display the information on a map. For example, the graph on the right contains information about the Total Population in the United States.

  • Display maps with geographic boundaries. CODAP can also create maps with geographic boundaries if the boundary information is included in a dataset, like in the map above. To do so, drag a boundary attribute onto the map. To add boundary information to a dataset, add a new attribute to the table by clicking the plus sign in the upper right corner. Give the new attribute a new name if you like, such as "Boundary" (click on the name of the new attribute and select "Rename"). Then, click on the name of the new attribute in the table and select "Edit Formula." Next, type in a formula to look up the boundary based on another attribute in the dataset. Typically this is an attribute specifying the name of the geographic areas. For example, the formula used to create state boundaries in the example shown above is: lookupBoundary(US_state_boundaries, state) ("state" is an attribute specifying the state names in this dataset, while "US_state_boundaries" is a set of boundaries where CODAP looks for the boundaries for the states listed under the "state" attribute). Once the boundary variable is added to the dataset, the boundaries will appear on the map. You may color the boundaries by the values of an attribute in the dataset by dragging that attribute and dropping it on the map. More information on how to enter a formula for an attribute can be found here and more information on the boundary lookup formulas can be found here. Additional information on how to set up map boundaries can be found here and in the video below. Note as shown in the video below, it is possible to import  boundaries into CODAP via a GeoJSON file, which you can either find by searching the web for something like "Canadian provinces GeoJSON file," for example, or by creating your own GeoJSON file (search the web for "create your own GeoJSON from a map").
  • To select multiple areas of a map with boundaries, hold down the Shift key, Command key (Mac), or Windows key (Windows) and click on each boundary area you wish to select. Note that these areas will also be selected in any graphs/tables you have open (and selecting the corresponding rows/points in a table or graph will also highlight their respective areas on the map). To deselect the areas, click on any part of the map that does not have boundaries. Or, if you have added an attribute to your map, you can click on a color in the legend to select the boundaries corresponding to those values on the map.
  • You can also color boundries by an attribute's values by dragging that attribute onto the graph. For categorical attributes, the boundaries for each distinct category will get a distinct color, as shown on the map's legend. You can learn about how the coloring works for numeric attributes here.

An example CODAP document with a map with boundaries can be found here.

The following video shows how to create map boundaries in CODAP that are not included in the standard boundary set in CODAP:

More detailed information on maps in CODAP can be found in the chapter on maps in Awash in Data by Tim Erickson.

Was this Article Useful? 

Add new comment

Comments are closed for the CODAP Help site. If you have a question or problem, please post on the CODAP Help Forum instead. Thank you.