After following this document the data from the US Census quickfacts site can be shown on a custom US Counties Choropleth map in SAP Lumira. An example map is here. It is based on the free personal edition of SAP Lumira which can be downloaded for free from this page.

Version 1.15 Screenshot

               /wp-content/uploads/2014/05/1example_449739.png

Version 1.28 Screenshots

               USCounties.PNG

Looks similar but 1.28 allows individual grouped counties to be shown, as per the state of Florida below.

Florida.PNG

Background

1.15 Extension – The custom US Counties map Lumira extension is based on the following

1) Document from Manfred Schwarz  Lumira Geoextension with datamaps.js and topojson.js , however no datamaps.js is used in this custom map. The great work by Manfred in regards to setting up require.js to use D3.v3 and topojson was used in this extension.

2) The custom US counties map is based on the same code found in a blog by Robert Russell (me:))  Custom Choropleth Maps with VizPacker

The custom topojson map of the US counties is based on an original county map found here  http://nationalatlas.gov/mld/countyp.html  No restrictions have been placed on the original US counties map

TOPOJSON was used to convert the map and simplify it.

1.28 version was created via WEBIDE and now only uses topojson as WEBIDE now (finally ) uses D3 V3.

Version Information

Version
Download Location
Lumira Version

Version 1

9th May 2014

Custom US Counties Map – Download the extension here.


Install the 1.15 extension

Download the extension from the link provided “Version Information” section above.

1) Quit SAP Lumira to install the extension.

2) Extract the downloaded file into the Lumira extensions folder (administrator authorisation is required)

C:\Program Files\SAP Lumira\Desktop\extensions


After extracting the file you should have the following folder

C:\Program Files\SAP Lumira\Desktop\extensions\bundles\viz\ext\rjruscountiesv1\


  With the following files required for the US counties choropleth map

  1. d3.v3.js
  2. domReady.js
  3. rjruscountiesv1-bundle.js
  4. topojson.v1.min.js
1.15

Version 2

14th Nov 2015

Custom US Counites Map – Download the extension here.


Install the 1.28 extension

Use the Extension Manager – Menu option File->Extensions

Select Manual Installation and select the downloaded zip file. A Restart of Lumira is required as per the screenshot below


InstallScreenShot.PNG

1.28

Download US Census QuickFacts Data

Download the following files from the quickfacts census site

http://quickfacts.census.gov/qfd/download_data.html

  1. DataSet.txt
  2. DataDict.txt
  3. FIPS_CountyName.txt

Download all files to a local drive.

There is a requirement to convert the data into excel files. This is required to ensure that leading zeros are not dropped from the FIPS county codes.

On the quickfacts download page there is a description of how to format the data. Some screenshots are below to highlight the necessary steps for the FIPS data and variations found in loading the data.

1) Convert the DataSet.txt to an Excel format

               /wp-content/uploads/2014/05/2dataset_449740.png

Essential to format the FIPS column as Text as this is to prevent the leading 0 being dropped from some of the county FIP codes.

Save as a new Excel file

2) Convert the DataDict.txt file to an Excel format

Following options taken when splitting the DataDict file which is different to how it is described on the download page.

               /wp-content/uploads/2014/05/3datadictstep2_449744.png

               /wp-content/uploads/2014/05/4datadictstep23_449745.png


Save as a new Excel file

3) Convert the FIPS_CountyName.txt  file to an Excel format

Again it is important to load the FIPS data as follows

               /wp-content/uploads/2014/05/5fipsstep1_449746.png


Essential to use Text as column name as shown.

               /wp-content/uploads/2014/05/6fipsstep2_449747.png


Split the United States Column (Column B)

Select only Column B select Data and split into Columns as shown below

               /wp-content/uploads/2014/05/7fipsstep3_449748.png

               /wp-content/uploads/2014/05/8fipsstep4_449749.png

ADD column header names

               /wp-content/uploads/2014/05/9fipsstep5_449750.png


Save as new Excel file

Format Data

Insert two rows at the top of the new Excel file DataSet.xslx


Follow the section to add descriptive headings to the DataSet file on the download page.

“Copy headings from DataDict to the top of the DataSet worksheet”


The final DataSet.xslx file should look like this.

               /wp-content/uploads/2014/05/10datasetheaders_449751.png


Save the DataSet.xslx file and the rest of the work is in Lumira.

Lumira will be used to add the county names as follows.

Load the FIPS_CountyName.xslx file and DataSet.xslx and take the option to merge the data.

The result should be a 100% match on the FIPS columns in both files.

               /wp-content/uploads/2014/05/11merge_449752.png

Add a filter to exclude the “blank” States in the State CODE column, so only US counties will be available in Lumira visualisations.

               12noBlanks.png


Select the Custom chart “US Counties – SCN demo”  as shown below.

               /wp-content/uploads/2014/05/13uscounties_449754.png

Select Measure required and the FIPS dimension as per the example shown below.

finalIMAGE.PNG

*this is an SCN document so if it is of interest please feel free to adapt the steps if you find any issues. As it is a collaborative document I have left it open for changes.

.

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply