Questions tagged [topojson]

TopoJSON is an extension of GeoJSON that encodes topology.

Filter by
Sorted by
Tagged with
36
votes
2answers
14k views

Convert GeoJSON to TopoJSON

Question How do you convert GeoJSON data to TopoJSON? Why Topojson files are often smaller than geojson and the conversion allows you to incrementally simplify a dataset, if you wish.
18
votes
5answers
12k views

GeoJSON too bulky - what to do?

I am using leaflet.js to allow web users to select a region. Valid regions are US states, Canadian providences, and world countries (except for US and Canada). I constructed a shapefile myself using ...
18
votes
1answer
5k views

What is topojson and how is it different than geojson?

This is a conceptual question. What are the differences between these? and what are the pros and cons of these formats?
16
votes
1answer
441 views

rMaps choropleth with custom json

With R I want to make an animated choropleth map with the rMaps package and a custom map. I tried to follow the example of Diego Valle described here and to use the custom map info for Datamaps. ...
12
votes
3answers
8k views

D3 for maps---at what stage to bring in data to the geo?

I'd like to map a world choropleth for display with D3, a la: http://bl.ocks.org/mbostock/4206573 http://bl.ocks.org/jasondavies/4188334 I have a dataset I'd like to display that's keyed to ISO-...
8
votes
2answers
5k views

How to reduce the file size of GeoJSON data?

For my project I am trying to convert the tiger shapefile information for us states into GeoJSON format However when I use the ogr2ogr tool the data file is about 20 MB. I have seen the geoJSON file ...
7
votes
0answers
1k views

Extract TopoJSON directly from PostGIS

I have a simple "region" table: id (TEXT), name (TEXT), geom (MULTIPOLYGON). Here's the query I can use to extract a GeoJSON FeatureCollection: SELECT row_to_json(fc) FROM ( SELECT '...
6
votes
2answers
4k views

How to merge TopoJSON features?

I currently have a coordinate based map of the US and it's states for topojson (https://github.com/mbostock/topojson). The coordinates are a JSON array (as topojson works), data looks like this: [-...
6
votes
2answers
3k views

Which plugin can draw topoJson right within Leaflet without conversion?

I already have asked how to reduce file size and increase performance for publishing spatial data on the web using Leaflet, here. A conversion to TopoJSON has reduced the file size by approximately ...
6
votes
2answers
3k views

TopoJSON: how to calculate scale and translate?

Context: I'm using the topojson file format along with d3. Since I could not find a library in Python that handles this format, I'm writing one. I've got the topojson to other formats working. ...
5
votes
2answers
5k views

How to load big geo-data file into web application

I am building a web app where I show details in map. I load data using geojson file (190 mb). I was looking in different possibilities to show the data, here there are: Leaflet GeoJSon: it should ...
5
votes
1answer
3k views

Where can I get a TopoJSON with 3 digit zip codes (zip3) shapes?

Where can I get a TopoJSON file with 3 digit zip codes (zip3) shapes I have searched for days and I just can find 5 digit zip codes shapes.
5
votes
3answers
2k views

How to properly convert landmass NaturalEarth data into GeoJSON?

100% Newbie. I've been following Mike's d3 Map Tutorial and I've come up against a challenge. I guess my question essentially boils down to: how does one generate the proper GeoJSON/TopoJSON files ...
5
votes
2answers
3k views

OGR merge shapefiles of different geom type into a single GeoJSON feature collection

I'd like to merge shapefiles of different geometry types into a single geojson feature collection, but OGR says it doesn't support update of GeoJSON files: $ ogr2ogr -f GeoJSON -t_srs crs:84 -lco ...
4
votes
1answer
1k views

How to avoid corrupt geometries when translating between TopoJSON and GeoJSON?

I'm trying to display some geojson vector features on a leaflet map. The size of my GeoJSON is too big (25.4mb of data, 8.47mb gzipped), so I'm trying to use a TopoJSON format to reduce the size ...
4
votes
2answers
649 views

Creating a TopoJSON file with countries that also includes sovereign countries

I am looking for a TopoJSON file that includes all countries including what I ended up after looking as 'sovereign countries' found in the following link: https://en.wikipedia.org/wiki/...
4
votes
1answer
339 views

Vector Tiles for NetCDF Data [closed]

I understand that the GeoServer can produce vector tiles in three formats: GeoJSON, TopoJSON, and MapBox Vector (MVT). Moreover vector tiles has many advantages in handling data such as reduced size ...
4
votes
1answer
4k views

Conversion from Shapefile to TopoJSON format results in incorrect map when rendered using d3js

I am trying to build a map of Canada showing FSA boundaries using d3js. I got shape data from Statistics Canada [http://www12.statcan.gc.ca/census-recensement/2011/geo/bound-limit/bound-limit-2011-eng....
4
votes
2answers
105 views

Seeking alternatives to Geodatabase to describe topological relations?

According to switchfromshapefile.org, there is no way to describe topological relations in a shapefile. I am aware that this can be done using a Geodatabase and I have heard of TopoJSON. If there are ...
4
votes
2answers
648 views

Which topology file formats are supported by QGIS?

I would like to know which topology file formats are supported by QGIS. I am particularly interested in displaying topologies encoded with TopoJSON or GML. But any other portable topology file ...
4
votes
1answer
309 views

Truly lossless TopoJSON / keep all coordinates in TopoJSON

I'm displaying GPX traces on a Leaflet map. I'm using TopoJSON to drastically reduce file size, which works pretty well. My problem is the following : I want to be able to display altitude and ...
3
votes
3answers
2k views

Batch conversion of Shapefiles to Topojson

Can i convert more than one shapefile .shp to topojson. Can this be performed using batch processing? I can convert shape file to topojson one by one but i have about 6000 files and i don't want to ...
3
votes
1answer
3k views

Either GeoJson to TopoJson conversion problem, or projection-issue with D3.js

My 'handcrafted' cartogram (How to create contiguous area cartograms in QGIS or R?) is ready to embed in code - I want to present it online with D3.js. Therefore I produced a topoJSON file of it - ...
3
votes
1answer
59 views

Ghost feature in D3

I am very new. to GIS. I am making an interactive that uses TopoJSON. Starting with a shapefile map of the world that shows the last bit of the Russia on the left rather than attached to the main ...
3
votes
1answer
125 views

No data pixels in raster file

I have a TIFF file and I'm trying to use rasterstats to get statistics of different geometries defined in a shapefile or a TopoJSON file. But I'm getting the count as 0 for all the geometries. My ...
3
votes
1answer
256 views

Troubleshooting with Tiger for d3 — is this the wrong projection? Why's it look like this?

UPDATE: Solved, sort of … I downloaded the file afresh and tried feeding it through ogr2ogr and topojson again … and wouldn't you know … after a while it worked. I think I was possibly not setting an ...
3
votes
1answer
544 views

Converting from shp to geojson fails

I'm following Mike Bostock's tutorial, let's make a map, but for a map of Mexico. I want to display state boundaries. I was able to get the map of Mexico from Natural Earth Data's world maps. My ...
3
votes
1answer
599 views

Which D3 microlibraries are required to load TopoJSON/GeoJSON files and translate into path definitions?

D3 v4 is modular, based on around 30 "microlibraries", intended to allow discrete functions to be broken out and used on their own. I'm trying to assemble a minimal set of D3 microlibraries to do the ...
3
votes
1answer
278 views

Simplifying TopoJSON causes leak of Natural Earth in d3

I'm working with topoJSON and D3 to display Natural Earth data on a globe. Obviously, we need to simplify our geometries while still keeping borders consistent. We've created a script as based on ...
3
votes
1answer
3k views

D3 adding topojson - no data visible

Yesterday I asked what would be the best method of creating an overlay in a web map that would allow for some interactivity. Create interactive map with no server Thanks to a variety of people who ...
2
votes
1answer
6k views

D3.js cannot render my geoJSON file

I've been trying to draw maps using the d3.js library in a manner similar to that below. <script> //Width and height var w = 500; var h = 300; //Define path ...
2
votes
1answer
2k views

leaflet-omnivore style function

Please pardon my ignorance in advance, but is it possible to style a layer(polygon) using the plugin leaflet-omnivore? All of the examples I've encountered are using the MapBox API I have the layer ...
2
votes
2answers
210 views

Remove countries from JSON file

I have this file nuts0.json that I would like to change by removing some countries like Iceland. To do this, I used the method I found in this post. Then I coverted the GeoJSON file to TopoJSON using ...
2
votes
1answer
1k views

Issue with using TopoJSON server API to return TopoJSON object with properties

I am creating a node application and using TopoJSON server API reference (see the link below) to convert a GeoJSON object to a TopoJSON object. TopoJSON server API reference I used these three lines ...
2
votes
1answer
582 views

simplilfy geojson file [duplicate]

I have a geojson file, but it's way too heavy for the app I need to develop I'd like to know what alternative do I have to make it lighter. I was thinking about simplifying it's shapes, and also ...
2
votes
1answer
443 views

D3 Map + TopoJSON (mapshaper) showing empty

Just started learn D3.js and TopoJSON. I had shapefile files and converted using mapshaper to TopoJSON, but when I tried on my local server my map showing empty page without any errors. I don't have ...
2
votes
1answer
143 views

Adjacency matrix from TopoJSON

I have a TopoJSON file which describes electoral districts in Montreal, and I would like to produce an adjacency matrix which would tell me which districts share a boundary with which other districts. ...
2
votes
4answers
1k views

Problems installing TopoJSON

I experienced problems with installing TopoJSON. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Platform.targets(64,5): error MSB8020: The build tools for Visual Studio 2010 (...
2
votes
1answer
362 views

Use UTF-8 encoding mapshaper

I want to convert a json into topoJson using mapshaper.org. The json file I am using has world wide names in it, hence is encoded in UTF-8. However, when I upload the file on mapshaper and then ...
2
votes
0answers
51 views

Converting .gri to topojson

I am making client-end javascript-powered maps in the context of web development. I am not using gdal, which I gather is a special kind of rendering software. Data source site: http://www.diva-gis....
2
votes
0answers
148 views

GeoJSON<->TopoJSON roundtrip breaks leaflet on antimeridean

For Wikipedia, I'm writing a service that extracts polygons of a country by a given ID, simplifies them, and produces GeoJSON. The PostGIS query produces this GeoJSON: {"type":"MultiPolygon","...
2
votes
0answers
292 views

TopoGeometry commands with postgres are really slow

After messing around quite a while, I was finally able to get a topogeometry converted from my geometry table following the example of toTopoGeom. I have the topology extension, with a topology schema ...
2
votes
0answers
337 views

How to remove projection in terminal from .shp file with valid .prj available

I have .prj, .shp, .sbn, .sbx, .shx, .dbf files where the content of the .prj file is the following: PROJCS["S-JTSK_Krovak_East_North",GEOGCS["GCS_S_JTSK",DATUM["D_S_JTSK",SPHEROID["Bessel_1841",...
2
votes
0answers
132 views

Combine files in TopoJSON when one is simplified differently to the other

I have two .shp files, I am separately converting these to GeoJSON with ogr2ogr.exe and then combining the files with TopoJSON. Each file independently becomes a ~200kb topojson file, however the ...
2
votes
0answers
255 views

Stray horizontal lines after converting from GeoJSON to topojson

After converting a GeoJSON file to topojson, and loading the topojson into Leaflet, stray lines appear in the resulting map. Like this: What is causing this? If I view the GeoJSON, these stray lines ...
2
votes
0answers
388 views

Filtering a Topojson on server-side. Which part of topology I need?

I have a big Topojson which I want to avoid loading it at page load. Instead I would like to parse on server-side at user request, sending back chunks of this original Topojson to be ploted. So I ...
2
votes
1answer
214 views

How do I merge csv data into topojson file?

I have a file, Council_Districts.topojson, with the following structure: { type: 'Topology', arcs: [...], transform: {...}, objects: { Council_Districts_2016: { type: 'GeometryCollection', ...
1
vote
1answer
3k views

How to merge/combine files in Mapshaper using combine-files command?

I'm trying to simplify several geojson and topojson files at once to output them into one file with a consistent level of detail. I'm using Mapshaper because I like it's map simplification features. ...
1
vote
1answer
799 views

TopoJSON without Quantization

I have been investigating using TopoJSON files to map floor plans for various buildings. As GeoJSON these files render perfectly, however after converting to TopoJSON they are missing a lot of the ...
1
vote
1answer
411 views

Remove some islands from Europe json file

It's the first time I use a JSON file to create a map of Europe. I downloaded these two files: nuts0.json nuts2.json The first represents the states, while the second represents the regions of each ...