topojson

Shapefile to Topojson conversion

我的梦境 提交于 2019-11-29 11:54:48
I am trying to convert the Ghana admin1 shapefile that can be found here . My end goal is to obtain a TopoJSON as described in this question . I have used this command on a Linux machine: ogr2ogr -f GeoJSON GHA_adm1.json GHA_adm1.shp And it returns this: Unable to open datasource `GHA_adm1.shp' with the following drivers. ... here goes a long list of drivers... I am I doing something wrong? Should I install other "drivers"? But how? Thanks. Hugolpz Download the GIS source GADM is the perfect source for administrative GIS files. GADM.org > Download page : select your country and format

Is it possible to determine if a GeoJSON point is inside a GeoJSON polygon using JavasScript?

家住魔仙堡 提交于 2019-11-29 11:26:30
问题 Is it possible to determine whether a GeoJSON point at a given lat,lon lies within a given GeoJSON polygon using only JavaScript (either through d3, topojson, or any other way)? For example, I can draw a map showing countries in the UK based on the tutorial here. I then have a some points which have coordinates but no indication as to which country they lie within. I would like to display a total point count for each country. Can I work out which country contains each point in the browser, or

D3js: How to design topographic maps?

时光总嘲笑我的痴心妄想 提交于 2019-11-29 08:15:49
问题 Given a GIS raster with elevation data, How to design a topographic map in D3js ? Is there any example of relief / topographic maps of cropped lands made using D3js ? Not working: I explored the posibility of .tif > gdal_contour.py > .shp > topojson > d3js without success. I use a makefile which contain all my commands. As my area of interest (France) is a crop of land areas, the gdal_contour.py approach generates broken isolines which does NOT create closed polygons. Also, the SVG end result

Error installing contextify- node-gyp rebuild failed

雨燕双飞 提交于 2019-11-29 07:17:14
问题 Edit I upgraded node and ran "npm install -g contextify" It looks like it installed fine (no errors), but typing in "which contextify" returns nothing. Message while installing contextify: npm http GET https://registry.npmjs.org/contextify npm http 304 https://registry.npmjs.org/contextify npm http GET https://registry.npmjs.org/bindings npm http 304 https://registry.npmjs.org/bindings > contextify@0.1.6 install /usr/local/share/npm/lib/node_modules/contextify > node-gyp rebuild CXX(target)

Topojson: quantization VS simplification

此生再无相见时 提交于 2019-11-28 17:11:24
问题 What is the difference between quantization and simplification ? Is quantization another way of doing simplification? Is it better to use quantization in certain situations? Or should i be using a combination of both? 回答1: The total size of your geometry is controlled by two factors: the number of points and the number of digits (the precision) of each coordinate . Say you have a large geometry with 1,000,000 points, where each two-dimensional point is represented as longitude in ±180° and

Difference between GeoJSON and TopoJSON

匆匆过客 提交于 2019-11-28 14:03:06
问题 What is the difference between GeoJSON and TopoJSON and when would I use one over the other? The description of TopoJSON on GitHub implies the TopoJSON files are 80% smaller. So why not just use TopoJSON all the time? 回答1: If you care about file size or topology, then use TopoJSON. If you don’t care about either, then use GeoJSON for simplicity’s sake. The primary advantage of TopoJSON is size. By eliminating redundancy and using a more efficent fixed-precision integer encoding of coordinates

How to divide a map into zipcodes using d3, javascript, and a json file?

心不动则不痛 提交于 2019-11-28 10:29:28
I'm trying to create a nyc map with zipcode areas I can color in based on census data (like color an area red if majority white or blue if majority nonwhite). I am simply using one of the shape files I found online from here ( https://data.cityofnewyork.us/Business/Zip-Code-Boundaries/i8iw-xf4u/data ). I converted the shp file to a geojson and then a topojson file. I'd appreciate it if someone could look at my code below, and let me know how I can go about doing this. Code: <!DOCTYPE html> <meta charset="utf-8"> <style> </style> <body> <script src="//d3js.org/d3.v3.min.js" charset="utf-8"><

D3.geo : responsive frame given a geojson object?

こ雲淡風輕ζ 提交于 2019-11-28 01:58:40
问题 I use Mike Bostock's code to Center a map in d3 given a geoJSON object. The important part of the code is this: var width = 960, height = 500; var svg = d3.select("body").append("svg") .attr("width", width) .attr("height", height); d3.json("/d/4090846/us.json", function(error, us) { var states = topojson.feature(us, us.objects.states), state = states.features.filter(function(d) { return d.id === 34; })[0]; /* ******************* AUTOCENTERING ************************* */ // Create a unit

Is it possible to read geoJSON or topoJSON file in R to draw a choropleth map?

倖福魔咒の 提交于 2019-11-27 14:21:09
topoJSON and geoJSON files are know very common for drawing maps on the internet. Is it possible to import them in R to draw choropleth maps? Spacedman Get the rgdal package installed. Then if: library(rgdal) > "GeoJSON" %in% ogrDrivers()$name [1] TRUE then you can do something like: > map = readOGR("foo.json", "OGRGeoJSON") > plot(map) But you need GeoJSON support in your ogrDrivers list. 来源: https://stackoverflow.com/questions/24183007/is-it-possible-to-read-geojson-or-topojson-file-in-r-to-draw-a-choropleth-map

How to add properties to topojson file?

僤鯓⒐⒋嵵緔 提交于 2019-11-27 01:03:47
Given a data.tsv file such : id code name 1 AL Alabama 2 AK Alaska 4 AZ Arizona 5 AR Arkansas 6 CA California ... ... ... Given a topojson.json file such : (the structure is correct, the numeral values are random) { "type":"Topology", "transform": { "scale": [0.0015484881821515486,0.0010301030103010299], "translate":[-5.491666666666662,41.008333333333354] }, "objects": { "states": { "type":"GeometryCollection", "geometries": [ {"type":"Polygon","arcs":[[0]],"properties":{"code_2":"AL"}}, {"type":"Polygon","arcs":[[1]],"properties":{"code_2":"AK"}} ] } }, "arcs": [ [[2466,9916],[-25,-5],[3,-13]