geojson

Difference between GeoJSON and TopoJSON

做~自己de王妃 提交于 2019-11-29 18:51:09
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? mbostock 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, TopoJSON files are often an order of magnitude smaller than GeoJSON files. The secondary

Uncaught InvalidValueError: not a Feature or FeatureCollection

非 Y 不嫁゛ 提交于 2019-11-29 18:44:02
问题 After seeing a recent video by the Google Devs I decided to do a regional map of the UK. There were a couple of possibilities mentioned on this site that I've since had to dismiss* So I ended up using this site (example page of data downloads): http://mapit.mysociety.org/area/11804.html Notice the GeoJSON download as the third link down? Its about a 1Mb file size. When I first tried using it with my map: function initMap(){ var ukc = new google.maps.LatLng(54.8, -4.6); var mapOptions = { zoom

ng-repeat causing \"Error: 10 $digest() iterations reached. Aborting! when passing scope to leaflet directive

谁说我不能喝 提交于 2019-11-29 17:41:32
Edited: After some advices i came back to old version of how i wanted handle angular and leaflet, link to fiddler but still is not working, Explanation: It was working with angular-leaflet-directive, but this directive has very bad performance on firefox, to compare leaflet.js self is very good so i thought i will try to make some small directive on my own, maybe somebody has some advices what is wrong and how to fix it? Link to fiddler: fiddler I try to pass result from ng-repeat to leaflet directive, but when i do it, angular start "Error: 10 $digest() iterations reached. Aborting!, there is

How to add data to array in Mongoose Schema

二次信任 提交于 2019-11-29 17:32:28
Assuming the following schema, I am trying to save some GeoJSON data with Mongoose var simpleSchema = new Schema({ properties:{ name:String, surname:String }, location : { type : String, coordinates : [ Number , Number ] } }); This is how I try to save the document var a = new simple({properties:{name:"a", surname:"b"}, location:{type:"Point", coordinates:[1, 0]}}).save(function(err){...}); However, what I am getting in the database is ObjectId("542da9ab0882b41855ac3be0"), "properties" : { "name" : "a", "surname" : "b" }, "__v" : 0 } It looks like the whole location tag and data are missing.

D3.js + osm geojson = black rectangle

时光毁灭记忆、已成空白 提交于 2019-11-29 17:09:03
I am trying to visualize russians regions. I got data from here , validate here and all was well - picture . But when I try to draw it, I receive only one big black rectangle. var width = 700, height = 400; var svg = d3.select(".graph").append("svg") .attr("viewBox", "0 0 " + (width) + " " + (height)) .style("max-width", "700px") .style("margin", "10px auto"); d3.json("83.json", function (error, mapData) { var features = mapData.features; var path = d3.geoPath().projection(d3.geoMercator()); svg.append("g") .attr("class", "region") .selectAll("path") .data(features) .enter() .append("path")

Mapbox Driving Direction with Custom Marker

為{幸葍}努か 提交于 2019-11-29 16:57:01
I have the following code to use mapbox as my driving direction, but unfortunately it doesn't allow me to change the markers, and it keeps using its default marker even though I try to change it with geoJson <script> L.mapbox.accessToken = 'pk.eyJ1IjoiZmFyc2hpZGFsYXZpIiwiYSI6ImNpZjNmNTRrYzQ0b2xzNWx1bXN5MnlmdjUifQ.IvZZfdiPe4rxQNolE88fhg'; var __journey = {"logbook":"29","consumer":"732","account":"1","category":"13","source":"2","platform":"4","vehicle":"25","label":"Farshid","startingodometer":"20000","endingodometer":"22721","note":"","status":"unverified","isreimbursable":"no","isdeductible"

Geojson map with D3 only rendering a single path in a feature collection

与世无争的帅哥 提交于 2019-11-29 15:18:13
I'm trying to draw a geojson map of some regions of Colombia. Currently it only shows a single path:, My feature collection has 52 features, but I can only draw this one feature. I do not know what I'm doing wrong, I'm based my code on other tutorials. How can I do to show all the paths? var features = mapData.features; console.log(features); // Update color scale domain based on data // Draw each province as a path mapLayer.selectAll('path') .data(features) .enter().append('path') .attr('d', path) .attr('vector-effect', 'non-scaling-stroke') Here is my full code: https://plnkr.co/edit

GeoJSON data not displaying in Python folium map

╄→尐↘猪︶ㄣ 提交于 2019-11-29 14:48:55
I am trying to display the following geojson file in a folium map in Python but it just shows an empty map with none of the data. Here are the steps I have tried: I tried using the python code below but nothing shows up. I tried other geojson files in the github repository below using the same code and the data show up without any issue, so it looks like my python code is fine I opened the "census_tracts_2010.geojson" file in github and Mapshaper , the data showed up perfectly without any issue, so it doesn't look like the geojson file is corrupted Could anyone please let me know how I can fix

Cannot update .geojson file for app submission on App Store

一世执手 提交于 2019-11-29 12:44:45
My GeoJSON file is supposed to cover the entire world. Here is the GeoJSON file: { "type": "MultiPolygon", "coordinates": [ [[[-169.4,58.8], [-168.0,83.4], [188.4,83.3], [194.0,-72.8], [-166.6,-73.6], [-169.4,58.8]]] ] } The name of the file is example.GeoJSON . I keep getting the following error when uploading the file: Your routing app coverage file is invalid. For more information see the Developer Guide. What is wrong with the above file? My app has a mapkit that shows the annotation of a particular place depending on the place that is chosen. When tapping the map in the app, Apple Maps

D3 filtering data points

落花浮王杯 提交于 2019-11-29 12:35:52
I'm implementing the classic mercator example (https://github.com/mbostock/d3/blob/master/examples/mercator/mercator.html), which I've changed to zoom into Afghanistan and to use only one custom slider. I'm reading in GeoJSON data of places where explosions have happened and the graph maps them all at load. I want to use the slider to view only a month of explosion points at a time but am having trouble filtering the results. I've tried several things based on posts in the Google group but fail to understand how to filter the data read in previously from 'explosions.json'. Thanks for the help!