TopoJSON arcs is undefined, coordinates is undefined, o is undefined
NickName:liamthorne4 Ask DateTime:2021-12-05T10:00:50

TopoJSON arcs is undefined, coordinates is undefined, o is undefined

I am very new to d3 and topojson and I am trying to render a map of the UK to overlay some data onto later. I have taken a topojson file from an online repository which is clearly fine since GitHub can render it. I am running this in a view specific json file for rails with d3 and topojson installed using webpacker.

I am currently importing d3, topojson and the uk map json file:

import * as d3 from 'd3';
import * as topojson from 'topojson';
import * as uk from './uk.json';

Then I try to draw the map:

let svg = d3.select('#geo-plot');
let feature = topojson.feature(uk, uk.objects.GBR_adm2);
svg.append("g")
        .selectAll("path")
        .data(feature)
        .join("path")
        .attr("fill", "#ed87c8")
        .attr("stroke", "white")
        .attr("stroke-width", 0.4)
        .attr("d", d3.geoPath(d3.geoMercator()));

I get the error arcs is undefined while running topology.feature(...)

If I pass uk.objects.GBR_adm2.geometries to feature is of type Feature but has no geometries.

I have a degree of success when passing uk.objects.GBR_adm2.geometries to .data() directly but I get the error coordinates is undefined.

If I pass uk.objects.GBR_adm2 or uk.objects to .data(), nothing happens and I get no error.

I have tried all of these steps with another map and had the exact same outcome

I am trying to follow online tutorials but nobody seems to be running into these problems. Any help or advice is much appreciated.

Thanks a lot

Copyright Notice:Content Author:「liamthorne4」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/70230949/topojson-arcs-is-undefined-coordinates-is-undefined-o-is-undefined

More about “TopoJSON arcs is undefined, coordinates is undefined, o is undefined” related questions

TopoJSON arcs is undefined, coordinates is undefined, o is undefined

I am very new to d3 and topojson and I am trying to render a map of the UK to overlay some data onto later. I have taken a topojson file from an online repository which is clearly fine since GitHub...

Show Detail

Hand-Generated TopoJSON not Parsing

I wrote a simple function to parse a the results of d3.geom.voronoi into topoJSON format, which you can see here: http://bl.ocks.org/emeeks/9908143 As far as I can tell, it matches up with the to...

Show Detail

Topojson 'default' property is Undefined

I've been trying to debug this for the last hour or so to no avail. I'm attempting to use d3-world-maps, which has a dependency on topojson. Inside the d3-world-maps package lies the issue: var

Show Detail

undefined symbol: llvm_gcda_emit_arcs error when running "emcc -fprofile-arcs -ftest-coverage"

Run command: emcc -fprofile-arcs -ftest-coverage demo.cpp Error response: error: undefined symbol: llvm_gcda_emit_arcs (referenced by top-level compiled C/C++ code) warning: Link with `-

Show Detail

topojson Uncaught TypeError: Cannot read property 'feature' of undefined

Background JavaScript is failing on a call to topojson.feature(topology, object). That's the documentation for topojson-client which looks to have been added when topojson went to 2.x, but it's th...

Show Detail

Shp to topojson WITH filtering in one command?

I usually see and use a first ogr2ogr comand to convert from .shp to .geoJSON. In a second command, I use topojson.js to convert from .geoJSON to .topoJSON format, with simplification of the precis...

Show Detail

Undefined references in make

I'm having some trouble compiling a program called RNASalsa (source code here). According to the manual, all I heve to do is download the tar.gz file and do tar zxvf RNAsalsa_xxx.tar.gz cd RNAsals...

Show Detail

JavaScript: undefined !== undefined?

NOTE: As per ECMAScript5.1, section 15.1.1.3, window.undefined is read-only. Modern browsers implement this correctly. for example: Safari 5.1, Firefox 7, Chrome 20, etc. Undefined is still change...

Show Detail

Error mapping US Zip codes with topojson

After loading a US zipcode topojson file I am getting an error in d3.js. groupdata is undefined on this line: function bind(group, groupData) { var i, n = group.length, m = groupData.length...

Show Detail

undefined symbols in .o file

I am using icc12 to make a project that contains three files: .s file containing a series of subroutines in assembly language .h file with a list of the functions .c program containing my main c...

Show Detail