topojson

Creating map of Africa using d3.js and topoJSON

醉酒当歌 提交于 2019-12-08 01:04:03
问题 i want to create map of Africa using d3.js and topoJSON. I have that datasource https://gist.githubusercontent.com/bricedev/3905007f1794b0cb0bcd/raw/ad5c995f6990f7c3c7fad5c6206bc6fd5462f1fb/africa.json That is my code. How i can get properties and create correct map? Please help me where is the error? <!DOCTYPE html> <html> <head> <meta name="description" content="D3byEX 12.15" /> <meta charset="utf-8"> </head> <body> <script src="http://d3js.org/d3.v3.min.js"></script> <script src="http:/

Crispy edges with topojson?

房东的猫 提交于 2019-12-07 23:41:58
问题 Mike Bostock shared a range of world wide topojson files. As I wanted more data and higher quality, I now generate my own high quality topojson files from Natural Earth. To make it simple, my makefile / command is such: admin_0: crop ../node_modules/topojson/bin/topojson \ --id-property name \ -p name=name \ -q 1e4 \ --filter=small \ -o admin_0.topo.json \ -- admin_0=./natural_earth_vector/10m_cultural/ne_10m_admin_0_countries.shp But my 3MB .topojson is crispy, nasty, graphically messy. Take

Topojson: How to design valid polygons, lines, points in GIS softwares?

倾然丶 夕夏残阳落幕 提交于 2019-12-07 21:20:00
问题 Up to now I always used GIS files from the web, which provide me administrative polygons, rivers, landmasses, etc. I then convert them to Topojson format to feed D3js. Today I have to design my own layer (wine_areas) within Quantum GIS (QGIS). Similarly, this .shp file will later on be converted into Topojson format. When designing my shapes, lines, dots within a GIS software (.shp file): What are the critical aspects I should worry about, and how to do so the .shp and the final Topojson

topoJSON on D3: map doesn't show (but it works on www.mapshaper.org)

五迷三道 提交于 2019-12-07 07:50:27
I'm trying to replicate http://bl.ocks.org/mbostock/4060606 using a UK Counties map. I followed the following steps - pretty much what is suggested on http://bost.ocks.org/mike/map : 1) I downloaded the shapefile from Ordnance Survey and extracted some data using qGIS 2) when ready, I translated the shapefile into GeoJSON using ogr2ogr 3) I converted the GeoJSON into topoJSON making sure the IDs were preserved I pretty much copied the original example for the choropleth from mbostock. However, instead of a nice map, I get a... circle. I wonder if I'm doing some errors with the projection? For

How to keep d3 orthographic projection centered when zooming

ぃ、小莉子 提交于 2019-12-07 05:20:30
问题 I am trying to replicate the zoom functionality shown in Jason Davies "Rotate the World" visualization (https://www.jasondavies.com/maps/rotate/) I am able to rotate and zoom, however, if I zoom after rotating, my projection is zoomed at an angle (meaning, if I turn the globe 15 degrees to the left and then zoom, the globe no longer stays centered in the canvas). Below is my code, any help would be greatly appreciated! d3.select(window) .on("mousemove", mousemove) .on("mouseup", mouseup); var

Trouble installing topojson on ubuntu

老子叫甜甜 提交于 2019-12-07 02:59:33
问题 I've been trying to install topojson by following Mike Bostock's Let's Make a Map tutorial http://bost.ocks.org/mike/map/ and I believe I have managed to get the most recent version of Node.js and npm. $which ogr2ogr works as well. I'm quite new to programming and Ubuntu and would sincerely appreciate some thorough help as to why npm install topojson -g yields the following errors. When I try the same command with sudo it yields errors like: npm ERR! registry error parsing json and gyp ERR!

Properly scale a vector to fit a raster layer

岁酱吖の 提交于 2019-12-06 11:48:15
So I've created a clipped and reprojected raster image from a Natural Earth 2 data set. It is simple enough to set that as a base layer and project a vector layer on top of it. The problem I'm having is properly scaling the images so they align perfectly. Please refer to this block for the example: http://bl.ocks.org/mkessy/8545864 Here is what I've done so far: Use gdalwarp to reproject the raster to Albers Equal Area and clip to the bounding box of North Dakota, output the image to my desired resolution (960 x 500) In D3 I use the exact same projection and overlay the vector onto the raster

Convert Big GeoJSON into topoJSON

老子叫甜甜 提交于 2019-12-06 11:15:35
问题 I have a GeoJSON file that's about 1.4GB, and because of the filesize (?), the command line tool doesn't work. I use topojson comman tool such as: topojson {{ input file }} >> {{ output file }} Web tools have the same problem (the browser just hangs). What's the best way to convert that huge GeoJSON file? 回答1: Tool Using the Topojson command line should works fine. The API is short and well written, read it quickly. Your command topojson input.json >> output.json # what does `>>` ? The

Creating map of Africa using d3.js and topoJSON

不问归期 提交于 2019-12-06 09:28:36
i want to create map of Africa using d3.js and topoJSON. I have that datasource https://gist.githubusercontent.com/bricedev/3905007f1794b0cb0bcd/raw/ad5c995f6990f7c3c7fad5c6206bc6fd5462f1fb/africa.json That is my code. How i can get properties and create correct map? Please help me where is the error? <!DOCTYPE html> <html> <head> <meta name="description" content="D3byEX 12.15" /> <meta charset="utf-8"> </head> <body> <script src="http://d3js.org/d3.v3.min.js"></script> <script src="http://d3js.org/topojson.v1.min.js"></script> <script> var width = 1000, height = 728; var svg = d3.select("body

TopoJSON ‹‹properties›› field, how to get values with d3.js?

夙愿已清 提交于 2019-12-06 08:11:10
问题 I have TopoJSON file, it looks like this: {"type":"Topology","transform":{"scale":[0.03600360003702599,0.0040674580654071245],"translate":[-179.9999967702229,41.18684289776669],"objects":{"country":{"type":"GeometryCollection","geometries":[{"type":"Polygon","arcs":[[0]],"properties":{"AREA":29809500,"PERIMETER":21822.4,"region":"XYZ"}},… I want to use values of properties ("AREA","PERIMETER","region") in my d3.js code. I made attempt to get some values, but it didn't work: d3.json("map_topo