Skip to main content
Filter by
Sorted by
Tagged with
147 votes
11 answers
74k views

Currently in d3 if you have a geoJSON object that you are going to draw you have to scale it and translate it in order to get it to the size that one wants and translate it in order to center it. This ...
climboid's user avatar
  • 6,962
13 votes
2 answers
6k views

I am trying to make this map of the us scale smaller. Either to my SVG, or even manually. This is my code in its simplest from: function initializeMapDifferent(){ var svg = d3.select("#map")....
Jason Blevins's user avatar
5 votes
1 answer
861 views

To improve the performance of my online maps, especially on smartphones, I'm following Mike Bostock's advice to prepare the geodata as much as possible before uploading it to the server (as per his ...
Markus's user avatar
  • 538
10 votes
2 answers
19k views

I am needing a Python script to convert CSV data to GeoJSON output. The output should match the format, below: { "type": "FeatureCollection", "features": [ { "type": "Feature", "...
user5834454's user avatar
0 votes
0 answers
1k views

I have an issue with @turf/turf the last version, in my react native app "react-native": "0.58.0", "@turf/turf": "^5.1.6" I just followed the same example in ...
DevAS's user avatar
  • 827
27 votes
5 answers
128k views

I have have geojson data from a query which I now want to parse and print on screen. My current code is: import urllib import geojson while True: url = 'https://earthquake.usgs.gov/fdsnws/event/...
stonebe's user avatar
  • 522
12 votes
2 answers
6k views

I'm very new to mapping, and to Altair/Vega. There's an example in the Altair documentation for how to make a map starting with an outline of US states, which is created basically with: states = alt....
Jonathan's user avatar
  • 11.5k
4 votes
1 answer
2k views

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 ...
Fede's user avatar
  • 91
2 votes
1 answer
8k views

I have a requirement of using leaflet.js to add a map to my site. The site has an administration view where an admin can add markers and add description and image to each marker. I used the leaflet....
Moon123's user avatar
  • 153
1 vote
3 answers
3k views

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 ...
Farshid's user avatar
  • 23
11 votes
5 answers
17k views

I have a @Entity model that has a property of type com.vividsolutions.jts.geom.Point. When I try to render this model in a @RestController I get a recursion exception. (StackOverflowError); nested ...
Tom's user avatar
  • 4,181
7 votes
3 answers
13k views

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 ...
vkc's user avatar
  • 636
6 votes
1 answer
9k views

I'm working on a map that uses leaflet and is populated by data from a file in a GeoJson format. My overarching goal is to put graphs into the leaflet popups for each marker on the map. Getting the ...
Joel's user avatar
  • 439
5 votes
1 answer
4k views

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 ...
pr338's user avatar
  • 9,230
3 votes
2 answers
6k views

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 ...
GPierre's user avatar
  • 923
2 votes
2 answers
14k views

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 ...
user1245530's user avatar
2 votes
1 answer
2k views

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") ....
Hugolpz's user avatar
  • 18.4k
1 vote
2 answers
4k views

In Leaflet, how does one restrict the viewable part of a tile to the area contained within a polygon (or geojson), i.e., the intersection between a polygon and the tile beneath. Example use: display ...
VH-NZZ's user avatar
  • 5,468
0 votes
0 answers
250 views

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, ...
Igor's user avatar
  • 1,432
109 votes
3 answers
49k views

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 ...
Luke's user avatar
  • 1,521
35 votes
3 answers
30k views

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 ...
user5325596's user avatar
  • 2,450
30 votes
4 answers
39k views

I'm having difficulty loading the following JSON containing GIS data (https://data.cityofnewyork.us/resource/5rqd-h5ci.json) into a GeoDataFrame. The following code fails when I try to set the ...
blahblahblah's user avatar
  • 2,477
28 votes
4 answers
63k views

I have a json : { "itemTypes": { "food": 22, "electrical": 2 }, "itemCounts": { "NA": 211 } } Here the ...
Newbie's user avatar
  • 771
24 votes
3 answers
16k views

I would like to populate a GeoJson layer with data and then dynamically filter what features to show. I have gotten the filter function to work but I do not know how to change the filter and then ...
dani's user avatar
  • 5,040
22 votes
1 answer
7k views

I would like to load two geojson layers to my map and be able to style them independently with different rules. I can display both my geojson files with the below code, but since they are both part ...
user3750486's user avatar

1
2 3 4 5
8