Let's see what the spatial distribution of CSA dropoff points looks like when aggregated to Portland neighborhoods. We'll then put some popups on each neighborhood and share the map in a way that others could easily view it on the web.
- Go back to your CARTO.com home page (logged in), click Datasets (or Your Datasets), and upload the neighborhood_boundaries.geojson file located in your lesson data folder.
- Create a map out of the neighborhood data and play around with the polygon styling offered by CARTO Builder. This styling will be temporary, though. We're soon going to classify this data.
- Click the Add New Layer button, choose the csa_farm_dropoffs layer, and click Add Layer. Now you've got both your neighborhoods and CSAs on the map.
There are actually some built in options to aggregate the CSAs to well-known administrative regions such as country boundaries. You can see this option in the same area where you selected to use hexagons in the previous walkthrough. Neighborhood boundaries aren't built into CARTO in this way, however, so we'll have to load our own.
- Click the name of the neighborhood_boundaries layer to display its styling properties. Then click Analysis > Add New Analysis.
- Choose Intersect Second Layer, and click Add Analysis.
- Set the Target layer to your csa_farm_dropoffs layer, and click Apply.
This adds a field called count_vals to your neighborhoods layer. This field contains the number of CSA dropoff locations counted in each neighborhood. Now you'll style your polygons based on this new value.
- Click Style, and click the Fill color to bring up the styling options.
- Click By Value, then scroll down, and click the count_vals field.
- Choose a color ramp and classification scheme as you did with the hexbins.
One major disadvantage of the software at this time is that there is not an intuitive way to display the class boundaries; therefore we cannot get an informative legend about which values are encompassed in each class. This is a hindrance to critically reading and interpreting the map. If you figure out a way to do it, please share.
- Click Legend, and change the title from count_val to something more intuitive like Number of CSA dropoff points.
Now, let's design some nice pop-up boxes that people can use to get more information on a neighborhood through a mouse click or tap.
- Click Pop-Up, and choose the Light or Dark popup style.
- In the pop-up options, scroll down, and check the boxes to show the name and count_vals fields, in that order. You can drag and drop to re-order the fields in your pop-ups. See the image below if you need help.
- Label the name and count_vals fields with some intuitive names as shown below, such as Neighborhood and Number of dropoff locations, respectively.
- Rename the neighborhood_boundaries layer to something nicer, like Portland neighborhoods.
- Remove the CSA layer from the map if desired. You don't really need it any more to tell the story about where CSAs are distributed.
- When you're really happy with your map, go back to the layer list view, and click the Publish button.
- Click Publish.
- Copy the hyperlink in the Get the link box, and test it out in a fresh web browser. Test the pop-ups too. If something doesn't work at first, wait 5 - 10 minutes, and try again.
You can share this in emails, social media, etc., to allow others to explore your web map. If you make changes to your map, just click Share followed by Update, and it will update the map seen by your users on the web.