topojson

Reactjs + D3 v4 projection issue

自作多情 提交于 2019-12-12 03:36:00
问题 I have been on this for 10 hours now and I am starting to think that it is either something really small or something fundamental I am missing here. This is a simple component that all I want is to render the us map with the d3 version 4 via geoAlbersUsa and PROJECT it in a panel so that it is SCALED. If I remove the projection all works great and I get the map. The moment in any shape or form I do the projection it simply shows a colored rectangle. Here is the code: import React from 'react'

QGIS generated shapefile malformed when converted to topojson by mapshaper

梦想与她 提交于 2019-12-12 01:55:19
问题 So I started with a really small example that is working well. I used QGIS to draw a line and then converted it to topojson with mapshaper . Then I use D3.js to load and visualize it. This is the bigger but not working example: jsfiddle.net/kwoxer/kpL1uyy2/2/ As you can see it not showing just one line, it is showing crazy lines as if the convert gone wrong. Already tested different browsers. But as I said I already did a small line before with QGIS, converted it, and everything was fine. So

topojson command not added on npm install

旧时模样 提交于 2019-12-11 15:37:11
问题 I am getting an error when using topojson saying that the command cannot be found. I think the install has gone OK but there just isn't a command for topojson, but there are ones for topo2geo, topomerge etc. I'm using nvm if that is relevant and on mac. Some Node details: Grahams-MacBook-Air:data grahamfletcher$ ls -l /Users/grahamfletcher/.nvm/versions/node/v7.10.0/lib/node_modules/ total 0 drwxr-xr-x 3 grahamfletcher staff 102 14 Jul 22:01 @angular drwxr-xr-x 7 grahamfletcher staff 238 10

D3 Map not rendering Australian topojson file

你离开我真会死。 提交于 2019-12-11 13:37:21
问题 I have a JSON file that d3 map is not rendering an Australia TopoJSON file I have created. The same code renders an American map just fine. There are no errors in the browser inspector and both maps render fine on online visualisation sites like geojson.io. I have provided links to the JSON's. Australian TopoJSON Does not work with my code (but does work on geojson.io/#map=4/-27.97/125.22 ) American TopoJSON Does work with my code <html> <head> <script src="http://d3js.org/d3.v3.min.js"

d3 toposjon map troubleshooting … why does it look like all zig zags and shards?

耗尽温柔 提交于 2019-12-11 12:13:59
问题 UPDATE: solved, kind of. I spent some time learning ogr2ogr and topojson and made a topojson that works beautifully in D3. I'm not sure why the file spit out by mapshaper.org turned into shards in my hands; on their site, the file displays fine. ORIGINAL POST: There may be an answer out there, but how do you ask google "why does my d3 map look like zig zags and shards?" FWIW, "search by image" turned up nothing. ;) I suspect it's something with wrong projection or wrong conversion from

require.js error (topojson not loading)

此生再无相见时 提交于 2019-12-11 11:32:44
问题 Can anyone help me understand/fix this error? Uncaught ReferenceError: topojson is not defined I am new to requireJS and don't fully understand it. Thank you in advance! require.config({ paths: { d3: "//cdnjs.cloudflare.com/ajax/libs/d3/3.5.3/d3.min", geo: "//d3js.org/d3.geo.projection.v0.min", topo: "//d3js.org/topojson.v1.min" }, shim: { geo: { deps: ["d3"] }, topo:{ deps: ["d3","geo"] } } }); require(["d3","geo","topo"],function(){ $(document).ready(RecruitingData.ondomready); $(document)

How to create optimal world.topo.json file with IDs?

好久不见. 提交于 2019-12-11 10:03:04
问题 Given a massive shape file of world countries. Given I'am using Topojson@1.0 installed locally via npm install topojson@1.0 . talled locally via npm install topojson@1.0 . Given I have csv data for many countries such as FR,144145 EN,5643 DE,25667 ES,3567 US,83466 CN,34576 JA,69353 Given I want to bind that data to the Topojson+D3js generated SVG. Thus I want a light yet precise world-id.topojson file with the rights properties... so to ease up the CSV-SVG data biding via matchings ids. So, I

Plotting Lat/Long on map - D3.js v4

耗尽温柔 提交于 2019-12-11 08:48:14
问题 I have a simple map of the United States and I'm trying to plot some test Lat Long points. I found this block explaining the process but I'm having trouble converting the syntax to v4. Even when I run the exact code in the block it throws the same errors. I can see the d3.geoMercator() kind of 'flattens' the map. Is this needed? It seems trivial but I like the natural curvature the US map has without this. Curious what the correct approach is, and if some of the code is even necessary.

Draw SVG image on paths but as big as needed

半世苍凉 提交于 2019-12-11 08:27:58
问题 So I would like to show an image on a path . The pathes are created via topojson coordinates. The points are on the right position on my map. So the next thing is to show a SVG image on that point. I tried that with appending svg:image , but no chance. I also tried to bring it into the path with the same result. I nowhere can see that image. Here an example with an PNG image. Because at least that should work to exclude SVG issues: var featureCollection = topojson.feature(currentMap,

Combining additional data with Shapefile using GeoJSON and Gdal

孤街浪徒 提交于 2019-12-11 07:45:42
问题 I used Mike Bostock's great tutorial to make a simple map using downloaded shapefiles and processing them with GDAL into GeoJSON files. http://bost.ocks.org/mike/map/ I'm trying to build on this learning by taking a county-level shapefile map and marrying it with additional demographic data (CSV) so that I can load a single GeoJSON file and not have to use Javascript to merge the data at runtime. The goal is to have a county-level heatmap. The CSV file has an ID column that looks like this: