geojson

Is there any way to create two color border in leaflet multipolygon, polygon?

老子叫甜甜 提交于 2019-12-11 12:56:09
问题 How can I create a custom border to multipolygon with leaflet? I would like to have inner border black and outer red or vice versa. Example picture to show what I mean: Is there any way to do this? 回答1: You can use Leaflet Polyline Offset plugin to draw a duplicate polyline offset by a specified number of pixels and achieve somewhat the desired effect. L.polyline([ [48.3, 0.1], [48.3, 0.7], [48.7, 0.7], [48.7, 0.1], [48.3, 0.1] ], { fillColor: "none", weight: 4, lineJoin: "miter", color: "red

d3 toposjon map troubleshooting … why does it look like all zig zags and shards?

耗尽温柔 提交于 2019-12-11 12:13:59
问题 UPDATE: solved, kind of. I spent some time learning ogr2ogr and topojson and made a topojson that works beautifully in D3. I'm not sure why the file spit out by mapshaper.org turned into shards in my hands; on their site, the file displays fine. ORIGINAL POST: There may be an answer out there, but how do you ask google "why does my d3 map look like zig zags and shards?" FWIW, "search by image" turned up nothing. ;) I suspect it's something with wrong projection or wrong conversion from

Curved geojson polygon edges on map projections

会有一股神秘感。 提交于 2019-12-11 12:09:54
问题 I am trying to draw rectangles on different map projections using d3.js and geojson. The mapped coordinates seem right, however the edges appear curved in a strange way. I understand that this may have to do with the shortest path on the real Earth, but what I would like is that the edges follow the parallels/meridians graticule of the projection. Is there a way to do that? Can anyone help? Example: Aitoff Projection Example: Mercator Here is the code I am using: <!DOCTYPE html> <html> <head>

Is my geojson data file created correclty?

被刻印的时光 ゝ 提交于 2019-12-11 10:47:43
问题 I'm using this code to map power transformers on a leaflet map, but unfortunately when the map loads I don't find my data displayed. Can you please help me identify some problems(if any) in my code. I must admit that I'm new to web mapping so I just need some help here. Here is the javascript code I'm using: //global variables var map, fields = ["tx_id", "owner", "kva_rating", "prim_voltage", "sec_voltage", "serial_no", "area_name"], autocomplete = []; $(document).ready(initialize); function

projection([lat,lng]) keeps returning null

╄→гoц情女王★ 提交于 2019-12-11 10:33:19
问题 I'm trying to map several points from a GeoJSON file onto a map using the albersUsa projection. My code is as follows, but it fails to add the cx and cy attributes to the circle elements: var width = 960, height = 500; // set projection var projection = d3.geo.albersUsa() .scale(1000) .translate([width / 2, height / 2]); // create path variable var path = d3.geo.path().projection(projection); d3.json("us.json", function(error, topo) { states = topojson.feature(topo, topo.objects.states)

filtering d3 mercator map

≡放荡痞女 提交于 2019-12-11 09:55:27
问题 I am using Alan McConchie's block for a basic mercator map in d3. I've gotten it to work locally but am trying to filter the map to exclude certain countries (Antarctica for example). I don't want to simply remove it from the json file in case I ever need to bring it back and would rather find a non-destructive solution. From my digging, I think there is a way to filter using the code below in d3 based on country code but can't get it to work based on the example I'm using. Where do I include

GeoJSON Coordinates?

痞子三分冷 提交于 2019-12-11 09:51:23
问题 I have a GeoJSON file that I am trying to process in order to draw some features on top of google maps. The problem, however, is that the coordinates are not in the conventional latitude/longitude representation, but rather some large six/seven figure numbers. Example: { "type": "FeatureCollection", "features": [ { "type": "Feature", "id": 0, "properties": { "OBJECTID": 1, "YR_BUILT": 1950.0 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 772796.724674999713898, 2960766

D3 add graticule and geojson

亡梦爱人 提交于 2019-12-11 09:29:39
问题 When adding D3 graticule first and then calling d3.json , the very first feature within json doesn't show on the map. If I add d3.graticule within d3.json after appending paths, graticule will be drawn on top of the features, which is not what I wanted. Here is my JavaScript file: $(document).ready(function (){ $('.aToolTip').tooltip(); $('.aPopOver').popover(); // D3 Mapping Starts Here var h = $('#myMap').height(); var w = $('#myMap').width(); console.log("h = " + h , ", w = " + w); $('svg'

Trying to display a GeoJSON on Openlayers 3

 ̄綄美尐妖づ 提交于 2019-12-11 08:46:07
问题 I am trying to display a geojson file on an openlayers map. The openlayers map is already working, however I cannot figure out how to display the features from the geojson file. The example on their website is unfortunately not very helpful, as it is simply the geojson object being written directly into the file and then accessed later. I wish to take the features from a separate geojson file and display them on the map. This is what I have so far, copied directly from the example: var

Combining additional data with Shapefile using GeoJSON and Gdal

孤街浪徒 提交于 2019-12-11 07:45:42
问题 I used Mike Bostock's great tutorial to make a simple map using downloaded shapefiles and processing them with GDAL into GeoJSON files. http://bost.ocks.org/mike/map/ I'm trying to build on this learning by taking a county-level shapefile map and marrying it with additional demographic data (CSV) so that I can load a single GeoJSON file and not have to use Javascript to merge the data at runtime. The goal is to have a county-level heatmap. The CSV file has an ID column that looks like this: