topojson

Put markers to a map generated with topoJSON and d3.js

若如初见. 提交于 2019-12-06 08:09:24
问题 I am creating a map of a particular state, I have been experimenting with d3.js and topojson and have created a great map, but now I want to add a marker on the map. But now I have problems because as I add the marker have a GeoJSON file to add markers to the map generated and also the power I'd like to open a tooltip whenever a marker is pressed. My map is very similar to this: http://bl.ocks.org/mbostock/4699541 and all I want is to add markers to states through a GeoJSON file that has the

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

回眸只為那壹抹淺笑 提交于 2019-12-06 07:21:39
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 files is valid, with the expected typologies ? Mostly, with neighbor polygons sharing their common arcs,

D3.Geo performance on Pan/Zoom

萝らか妹 提交于 2019-12-06 07:16:45
问题 Last year I made a couple experiments on web maps using the Mapnik library (server-side, bitmap/tiling). Now I'm trying to replicate the same experiments using the vector, client-side approach with d3.js. I have a map (~680 shapes) where zoom is slow and pan is sluggish (this example by Mike Bostock works well). I suspect the problem is in the zoommove callback, the selectAll("path").attr("d", path) takes too long. function zoommove() { projection.translate(d3.event.translate).scale(d3.event

Crispy edges with topojson?

為{幸葍}努か 提交于 2019-12-06 06:06:22
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 a look at the coastline, you will see the most annoying thing : lines looking like "stairs" :

How to remove a leaflet label when a topojson layer containing it is removed

*爱你&永不变心* 提交于 2019-12-06 02:47:56
问题 I am trying to create an interactive map that visualizes certain data. I used leaflet map and a topojson layer on it. Next, I tried to add static labels on each of the topojson polygons using leaflet label plugin i.e. the labels should always be there and should not react to mouseover event. I tried implementing bindLabel() method with noHide:true , but it didn't seem to work. Therefore, I implemented the solution provided to this question Simple label on a leaflet (geojson) polygon . I

D3 - How to get correct scale and translate origin after manual zoom and pan to country path

*爱你&永不变心* 提交于 2019-12-06 02:44:31
问题 I've got a topology map with pan and zoom functionality. Clicking on the country, I'm zoom/panning into the country, using this: if (this.active === d) return var g = this.vis.select('g') g.selectAll(".active").classed("active", false) d3.select(path).classed('active', active = d) var b = this.path.bounds(d); g.transition().duration(750).attr("transform","translate(" + this.proj.translate() + ")" + "scale(" + .95 / Math.max((b[1][0] - b[0][0]) / this.options.width, (b[1][1] - b[0][1]) / this

Command line install of topojson throwing fatal error

本秂侑毒 提交于 2019-12-05 21:56:25
I'm trying to install topojson on OSX Maverick and I'm getting a fatal error: fatal error: 'sys/types.h' file not found . I include below what leads up to the error in the terminal and then everything that follows. I just installed node.js specifically for this - so I'm not sure which package the issue is related to. ... npm http 304 https://registry.npmjs.org/boom npm http 304 https://registry.npmjs.org/hoek npm http 304 https://registry.npmjs.org/delayed-stream/0.0.5 CXX(target) Release/obj.target/contextify/src/contextify.o In file included from ../src/contextify.cc:1: In file included from

Trouble installing topojson on ubuntu

天涯浪子 提交于 2019-12-05 07:58:38
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! stack Error: "pre" versions of node cannot be installed, use the --nodedir flag instead Thanks! npm ERR!

Adding tooltip in d3.js map

青春壹個敷衍的年華 提交于 2019-12-05 00:06:29
问题 I'm trying to add a tooltip showing the name of districts when you hover over it in the map in d3.js. The input is a topojson file and I've been able to successfully generate the map with district boundaries and highlight the currently selected district. For the tooltip I tried doing something similar to this, but nothing happens at all. The code I've used is given below. The tooltip code is towards the end. var width = 960, height = 600; var projection = d3.geo.albers() .center([87, 28])

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

我们两清 提交于 2019-12-04 15:07:36
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.json", function(error, map) { svg.append("path") .datum(topojson.object(map, map.objects.country)