When utilizing the topojson command to append attributes to a TopoJSON file, external csv data files are not being imported successfully

I am facing an issue with binding data from a csv to a topojson file where the data from the csv is not being added to the properties of the topojson objects. You can find the csv file here, and here is a snippet from it:

GEO.id,GEO.id2,GEO.display-label,HC01_EST_VC21,HC01_EST_VC22,HC01_EST_VC23
Id,Id2,Geography,Total; Estimate; Population 18 years and over,Total; Estimate; Population 18 years and over - Enrolled in college or graduate school %,Total; Estimate; Population 18 years and over - Enrolled in college or graduate school #
1400000US06001400100,6001400100,"Census Tract 4001, Alameda County, California",3056,25.5,779
1400000US06001400200,6001400200,"Census Tract 4002, Alameda County, California",1619,4.3,70

You can also access the topojson I am trying to bind the data to here, and a snippet of it:

{"type":"Topology","objects":{"cb_2015_06_tract_500k":{"type":"GeometryCollection","bbox":[-124.409591,32.534155999999996,-114.131211,42.009518],"geometries":[
{"type":"Polygon","properties":{"STATEFP":"06","COUNTYFP":"001","TRACTCE":"400600","AFFGEOID":"1400000US06001400600","GEOID":"06001400600","NAME":"4006","LSAD":"CT","ALAND":297856,"AWATER":0},"arcs":[[0,1,2,3,4]]},
{"type":"Polygon","properties":{"STATEFP":"06","COUNTYFP":"001","TRACTCE":"400900","AFFGEOID":"1400000US06001400900","GEOID":"06001400900","NAME":"4009","LSAD":"CT","ALAND":420877,"AWATER":0},"arcs":[[5,6,7,8]]},

I have tried using the command

topojson -o out.json -e education_dataset.csv --id-property=GEOID,GEO.id2 -p population=+HC01_EST_VC01 -- ca-tracts.json
to bind the column HC01_EST_VC01 from the csv to the population property in the topojson without success. I also attempted the command
topojson -o out.json -e education_dataset.csv --id-property=AFFGEOID,GEO.id -p population=+HC01_EST_VC01 -- ca-tracts.json
as the topojson has both AFFGEOID and GEOID, corresponding to columns in the csv GEO.id and GEO.id2, respectively. Any assistance on this matter would be greatly appreciated.

Answer №1

  1. Perhaps the --id-property cannot be used as Ge0.id2, so it should be changed to GEO instead.

  2. In the topojson data, you have GEOID as "06001440335" while your GEO.id2 is 6001440335. To compare them as numbers, make sure to include the + sign in front of both. --id-property=+GEOID,+GEO

  3. The HC01_EST_VC01 is not found in the provided csv file

After changing Geo.id2 to GEO and using "HC01_EST_VC21" for population, the command I successfully executed is:

topojson -o out.json -e education_dataset.csv --id-property=+GEOID,+GEO -p population=HC01_EST_VC21 -- ca-tracts.json

If you have any more questions, feel free to ask.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Is there a way to deserialize UTF8 encoded Byte[] in JavaScript within the browser or a Node.js application?

In my C# code, I have defined an event class like this: public class AreaInterventoCreata{ //public properties } var message= new AreaInterventoCreata(); After creating an instance of this class on the server side, I need to inform the subscribed cli ...

Struggling with defining the default value for a JavaScript array

One interesting feature on my website is a changing h1 heading that updates when the user clicks a button. However, I encountered an issue where, upon initial page load, the h1 appears empty and only populates with text after the button is clicked. I am ...

Is it feasible to extract the JSON array values in android without the JSON object values?

I am struggling with converting a Json array of the following type: "tags_name": ["Activity Based"] in android and storing the data using getter setter methods. I need help with creating a POJO class for this and handling the scenario when the array is emp ...

Stop the reloading of the parent page when the exit button is pressed on the popup screen

I have set up a modal popup that appears when a user clicks on a specific link. Inside the popup, I have included an exit button to close it. However, I am facing an issue where clicking on the exit button not only closes the popup but also reloads the par ...

Creating Classes with Closure Compiler Advanced Mode: Tips and Strategies

My coding project involves implementing a class with the following structure: function ExampleClass() { // constructor code } ExampleClass.prototype.sampleFunc = function () { // sample function }; ExampleClass.staticSampleFunc = function () { ...

Form Transitioning Through Multiple Steps During Mobile Device Resizing

I'm currently working on a mobile responsive web app and I have successfully adjusted it to display properly on mobile devices. However, I am now looking to implement a multi-step form instead of having the second form appear above the first one when ...

I've noticed the cookie named (_op_aixPageId) on multiple websites - can someone please explain what it is

Hello, our team recently conducted a scan of our website to ensure PCI compliance and discovered an unsecured cookie associated with our domain called (_op_aixPageId). Despite searching through our entire code base, we were unable to find any references ...

jQuery Waypoints does not activate

I am encountering an issue with using jQuery Waypoints on a website I am currently developing. Despite my efforts, I cannot seem to get it to trigger at all. Below is the code I have implemented: <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11 ...

Attempting to retrieve an element by its ID from a div that was dynamically loaded using AJAX

I am having trouble retrieving the value of an element with getElementById from a div that is loaded via ajax. Let me explain: In 'example.php' I have the following JavaScript code: <script type= "text/javascript"> var page=document.getE ...

Ensuring consistent geometry size regardless of renderer size is crucial - Plane resizing based on screen dimensions

https://i.sstatic.net/CwUxD.gif Here is a codepen showcasing the issue along with a GIF illustrating the confusion. Codepen: https://codepen.io/carelesscourage/pen/bGMWjNg My expectation I desire the plane to maintain the same size regardless of screen ...

What methods can be utilized to avoid displaying a Bootstrap popover intermittently within an AngularJS framework?

When using the bootstrap popover in a custom AngularJS directive, I need to display an error message when the button is disabled by setting $scope.buytypeButton= {type:false}. The error message should be displayed in a popover. On the other hand, when $sco ...

I'm only seeing output on two of my input boxes - what's going on?

Currently in the process of learning JQUERY/HTML, I decided to create a shopping cart. My goal is to display the subtotal, tax, shipping costs, and total cost in input boxes. While I successfully displayed the sub total and shipping cost, I encountered an ...

Exploring JSON data and making precise adjustments in JavaScript

I am attempting to create my own database using JavaScript and JSON, but I have encountered some issues along the way. My main struggle is figuring out how to extract specific content from a JSON file. After doing some research, I came across this code sn ...

Revamp your jQuery Ajax call by utilizing the Fetch API

Below is my attempt to convert the following jquery's AJAX call using the fetch function: const sendingData = {...} $.ajax({ url: "/api/data/getuser", type: "GET", data: sendingData , dataType: 'json', ContentType: &a ...

Creating a reliable and secure profile using Javascript

I am currently utilizing the server-side implementation of Reliable Secure Profile for HTTP/S push in .NET 4 and I am interested in finding out if there is a JavaScript client available. ...

Leveraging *ngFor to extract HTML content from ion-label

I've encountered an issue while using *ngFor in my HTML like this: <ion-slides #slides [options]="slideOpts"> <ion-slide class="numbers-wrapper" *ngFor="let questionNumber of numbers" (click)="clickQue ...

Assurance Code Evaluation

Recently, I've dived into the world of nodeJS and I'm getting acquainted with promises. After looking at the code below, it seems to me that it could be enhanced by integrating the retry logic within getValue2. It's important to note that ...

What is the solution for fixing the error when setting the Content-Type to "application/x-www-form-urlencoded" using xhttp.setRequestHeader()?

Despite searching extensively, I couldn't find the solution to this particular issue on Stack Overflow. Currently, my focus is on saving a large amount of HTML data to a database using AJAX JavaScript with PHP. Below is the snippet of my JavaScript c ...

Moving points from a .obj model that was brought in

Being new to three.js, I've been stuck on a rookie mistake for hours. After finding some useful examples of mesh editing and managing an imported model on the forum (link), I tried adapting my code based on this example but now I'm facing a probl ...

Determine whether an object exists within another object and merge its value into the formatted object

When filling out a form, I have a formattedData object that holds a deep copy of the original data object. If a field in the form is changed, I must update the formatted data object with properties from the values object. To simulate this scenario, I crea ...