Help creating region maps for US Census Tracts

59 views
Skip to first unread message

John Baldwin

unread,
Feb 8, 2020, 3:25:33 PM2/8/20
to TerriaJS
Hello,

I have Terria and GesServer up and running. I have 2 files, both contain and alphanumeric field called GEOID. The first is a CSV with the data and the other, stored on GeeServer is a shp file with the geographies.

I read about a regionMapping.json but I am unsure about how to use this file in conjunction with the csv and shp to display and style a map that doesn't have Australian geographies.

Can anyone help me out?

Thanks...Joe

Steve Bennett

unread,
Feb 8, 2020, 9:52:29 PM2/8/20
to terr...@googlegroups.com
Hi Joe,
  Setting up region mapping for a new boundary set is not exactly trivial. There are two approaches:

1) Using GeoServer to serve WMS, with a special style that colour codes each boundary with a unique color. This is described here: https://docs.terria.io/guide/deploying/setting-up-a-region-mapping-server/
2) Alternatively, you can use vector tiles. This is described here, although in the context of Terria's own vector tile hosting on AWS. You could host the vector tiles somewhere else (eg Mapbox) a lot more simply.

In theory there is not much difference in the end result, although the vector tile approach looks a bit better. However since (IIRC) Terria itself doesn't use the first method anymore, it's possible it will stop working at some point. Maybe.

I'd be interested to hear more about what you're working on, as I'm also doing some work with US statistical geographies (although not at the census tract level).

Steve

--
You received this message because you are subscribed to the Google Groups "TerriaJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to terriajs+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/terriajs/b9d49ea3-fad0-4d85-a76c-77ca8a743701%40googlegroups.com.

John Baldwin

unread,
Feb 9, 2020, 1:31:04 AM2/9/20
to terr...@googlegroups.com

Hi Steve,

Thanks for the prompt reply. This is the extent of my understanding right now. Terria has the capability to match geographies to variables contained in a csv file. The init files then instructs Terria how to compute bins and shade polygons accordingly. My geography file is HillsboroughTracts.shp (all Census tracts in Hillsborough County, FL) and the csv file is ALICE.csv, with a single column, ALICE, a poverty index. They share a US Census GEOID (see https://www.census.gov/programs-surveys/geography/guidance/geo-identifiers.html) , which is an alphanumeric designation, unique to each US Census geography.

I am not able to generalize from the Australian geographies and files nor am not quite sure what regionMapping.json is doing or if additional files are needed to produce a choropleth map with 5 bins. Is it possible to provide an explicit example using the file names above? I have done similar joins in QGIS, MapInfo and ArcGIS.

Let me know if you need further assistance with US Census geographies. I am a former government researcher/planner and happy to help out.

 

Regards,
Joe

Steve Bennett

unread,
Feb 11, 2020, 10:11:48 PM2/11/20
to terr...@googlegroups.com
On Sun, 9 Feb 2020 at 17:31, John Baldwin <joe.roc...@gmail.com> wrote:

Hi Steve,

Thanks for the prompt reply. This is the extent of my understanding right now. Terria has the capability to match geographies to variables contained in a csv file. The init files then instructs Terria how to compute bins and shade polygons accordingly. My geography file is HillsboroughTracts.shp (all Census tracts in Hillsborough County, FL) and the csv file is ALICE.csv, with a single column, ALICE, a poverty index. They share a US Census GEOID (see https://www.census.gov/programs-surveys/geography/guidance/geo-identifiers.html) , which is an alphanumeric designation, unique to each US Census geography.


Just checking you mean, the CSV has two columns: the data column (ALICE) and the id column (GEOID). If so, great.
 

I am not able to generalize from the Australian geographies and files nor am not quite sure what regionMapping.json is doing or if additional files are needed to produce a choropleth map with 5 bins. Is it possible to provide an explicit example using the file names above? I have done similar joins in QGIS, MapInfo and ArcGIS.


The part you're maybe missing is that the Shapefile has to be processed and hosted somewhere. Terria doesn't touch the Shapefile directly. Either you host it as WMS through GeoServer (with the special color-coded style), or you convert it into vector tiles and host those somewhere.

Then the regionmapping.json file tells Terria where you hosted the boundaries, when to apply them (ie, what column name in the CSV file should trigger it to use that particular set of boundaries), and the specifics of using the boundaries for color coding.
 
Does that make more sense? Which part are you stuck on exactly?

Steve

John Baldwin

unread,
Feb 12, 2020, 12:03:17 AM2/12/20
to terr...@googlegroups.com

Hi Steve,

 

I am actually making pretty good progress. I have:

  1. GeoServer set up and serving WMS. Terria maps it properly. (had a problem with permissions there)
  2. Terria can load a corresponding csv file, graph, display variable selector, etc.
  3. The 2 files share a common GEOID.

 

I wasn’t looking in the proper “build”directory, unfortunately. I still confused by the FID, not quite sure what that is. Documentation seedmed to stress the need for this.

 

HOWEVER:

 

If I am getting this right, I would next need to:

  1. Create a file with US ZIP code regionid file, for exampe “region_map-Hills_ZIP.json” containing all GEOIDS for ZIP codes in Hillsborough County, FL US
  2. Store that in “TerriaMap/wwwroot/build/TerriaJS/data/regionids”
  3. Create a new regionMapping.json, for US geographies, and store that in “TerriaMap/wwwroot/build/TerriaJS/data”
  4. Provide styling instructions for each layer via the init file.
  5. Bask in the reflective glow of a fully formatted chorophleth. 😊

 

I appreciate your help greatly. Much obliged.

 

…Joe

 

 

From: "terr...@googlegroups.com" <terr...@googlegroups.com> on behalf of Steve Bennett <ste...@gmail.com>
Reply-To: "terr...@googlegroups.com" <terr...@googlegroups.com>
Date: Tuesday, February 11, 2020 at 10:11 PM
To: "terr...@googlegroups.com" <terr...@googlegroups.com>
Subject: Re: [terriajs] Help creating region maps for US Census Tracts

 

On Sun, 9 Feb 2020 at 17:31, John Baldwin <joe.roc...@gmail.com> wrote:

--

You received this message because you are subscribed to the Google Groups "TerriaJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to terriajs+u...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages