GEOG 865
Cloud and Server GIS

Uploading data to CARTO and aggregating to hexbins


Let's go through the steps of uploading a basic dataset to CARTO and making a web map.

First, download the data for this lesson. This folder contains datasets that I derived from Portland Maps Open Data and OpenDataPhilly. They are stored in GeoJSON, a popular format based on JavaScript syntax that is used for interchanging vector data on the web.

Then follow these steps:

  1. In a web browser, visit
  2. Click the Sign Up link and enter your information to sign up for an account.

    After you log in, you will see two main links at the top of the homepage: Maps and Datasets. (Alternatively, you may see username/Maps or username/Datasets, where you can click a dropdown arrow to toggle). We'll use the Datasets link to upload and view our datasets, and the Maps link to design some maps from them.
  3. Click Datasets and click New Dataset. Examine all the input options: you can import data from Google Drive, ArcGIS Server, and Dropbox, for example. We're just going to use the simplest option here and bring it in from a raw file.
  4. Choose Data File, click the Browse button, and browse to csa_farm_dropoffs.geojson. Then click Connect Dataset. If you don't see the Browse button, try maximizing your web browser or otherwise enlarging the view.

    You should now see a table of this dataset. These are locations where local farms around Portland will bring their produce into the city. They drop it off at these points for urban residents who have signed up for community-supported agriculture (CSA) subscriptions. Mapping these points is one way to see which areas of Portland are currently being served by CSAs (and which ones are not).
  5. Click Create Map, and you'll see the points overlayed on a basemap of Portland. A labels layer sits on top. You're now in CARTO Builder, which is a map design center similar to the map viewer or Mapbox Studio (although Builder is more for styling thematic maps rather than basemaps).
  6. Click the label of the Positron layer and examine the variety of basemaps offered by CARTO. These are built from OpenStreetMap data. You can choose your favorite one for use in this exercise.

    Basemap selection in CARTO Builder
    Figure 6.1: Basemap selection in CARTO Builder
  7. Go back to the layer list and click the title of the csa_farm_dropoffs layer.
  8. Play around with changing the size, fill, and stroke (outline) properties of the points. Below I've changed the size to 10 and applied a pink fill with black stroke. You can set this up however you like.
    Point styling in CARTO Builder
    Figure 6.2: Point Styling in CARTO Builder
    Sometimes it's easier to visually make sense of a bunch of dense points by aggregating them to polygons of uniform size. Hexagons are a popular choice because they are compact and tessellate (fit together) easily. Let's aggregate these points to hexagons, or "hexbins" as cartographers sometimes call them.
  9. Still viewing the properties of the csa_farm_dropoffs layer, choose the hexagon aggregation (under the Aggregation menu marked number 1) and select a color ramp and size for the hexbins that appeals to you. This is somewhat of an art; if the hexbins are too small, you won't learn much more than if you viewed the raw points, and if the hexbins are too large the patterns in the data will be muted.
  10. Click the Fill color ramp and notice the options to change the number of buckets, or classes, that the data is divided into. You do this by clicking the ....
    Styling hexbins in CARTO Builder
    Figure 6.3: Styling hexbins in CARTO Builder
    You can also change the classification scheme. Right now it's set at Quantiles, which ensures that there will be an equal number of hexbins in each class, or color. You can apply other classification schemes commonly used by cartographers, such as equal interval or Jenks natural breaks.
  11. Experiment with adjusting the classification system by changing it to Jenks with 4 buckets.
  12. Set a classification scheme and number of buckets that you feel best tells the story about where Portland is serviced by CSAs. Notice how much power that you have over the message implicit in the map patterns. This is true with all cartography and not just online tools, yet interactive web GIS of this nature brings the power of the cartographer to the forefront.

In some situations you might want to aggregate to well-known boundaries of political units or some other polygons of non-uniform shape. In the next part of the lesson, we'll see how you could aggregate to neighborhood boundaries and share the resulting map.