Questions tagged [geojson]

GeoJSON is an open format, based on JSON, for encoding geographic data.

GeoJSON is a geospatial data interchange format based on JSON. It defines the following geometries:

  • Position
  • Point
  • MultiPoint
  • LineString
  • MultiLineString
  • Polygon
  • MultiPolygon
  • GeometryCollection.

Example of a GeoJSON Point:

{ 
    "type": "Point",
    "coordinates": [0.0, 0.0]
}

Resources :

3719 questions
142
votes
11 answers

Center a map in d3 given a geoJSON object

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 is a very tedious task of trial and error, and I…
climboid
  • 6,776
  • 14
  • 42
  • 68
95
votes
3 answers

Difference between GeoJSON and TopoJSON

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?
Luke
  • 1,381
  • 2
  • 11
  • 11
39
votes
1 answer

Loading a geoJSON object directly into google maps v3

I'm trying to create a map, using floor plans that I've stored in mongodb. If I put the JSON into a file, I can call it using map.data.loadGeoJson('myfile.json') However, I don't want to save a file each time I build a map, and I'd rather write an…
Itinerati
  • 783
  • 2
  • 8
  • 17
37
votes
3 answers

Point in Polygon with geoJSON in Python

I have a geoJSON database with lots of polygons (census tracts specifically) and I have lots of long,lat points. I am hoping that there would exist an efficient Python code to identify which census tract a given coordinate is in, however so far my…
Benjamin Horowitz
  • 534
  • 1
  • 5
  • 10
34
votes
4 answers

How/Where do I get geoJSON data for states, provinces, and administrative regions of non-US countries?

I need geoJSON formatted paths for states, provinces, and regions within multiple countries. Most readily available geoJSON data is for US states and country level boundaries, not regions within the country. This geoJSON will be used to create a…
beauburrier
  • 1,311
  • 1
  • 16
  • 18
33
votes
4 answers

GeoJson World Database

I am working on a project where it is necessary to display maps of countries and cities using d3.js. Actually, D3 supports GeoJson format. Usually, I guess, GeoJson format is converted from some other format. I found some places with this GeoJson…
todotresde
  • 1,620
  • 2
  • 19
  • 25
30
votes
2 answers

How to interact with leaflet marker layer from outside the map?

I have a leaflet map showing points for public art pieces, rendered from GeoJSON. Next to the map, I created a list of the pieces from the same GeoJSON data and want to be able to click on an item from the list outside of the map and have the…
roy
  • 3,047
  • 5
  • 27
  • 49
29
votes
2 answers

PHP / Mongo geoJSON Loop is not valid

I'm passing in some coordinates to mongo to do a geo search. It works fine if the coordinates don't intersect (for instance a figure eight). But when two lines intersect it gives the loop is not valid. Is there any way to find the intersection and…
Rob
  • 8,480
  • 15
  • 58
  • 102
29
votes
5 answers

How does one represent MongoDB GeoJSON fields in a Mongoose Schema?

MongoDB 2.4 allows the use of GeoJSON objects and a slew of neat functions and indexes that I'd like to use. It expects GeoJSON objects to be stored in the format like: loc: { type: 'Polygon', coordinates: [[[-180.0, 10.0], [20.0, 90.0], [180.0,…
Zugwalt
  • 19,935
  • 20
  • 77
  • 99
26
votes
3 answers

Smoothing arcs/plot points in D3.js/GeoJSON/TopoJSON/Shapefile (somewhere along the way)

I've been looking around a while for an answer to this, and I haven't been able to figure it out. I'm ultimately creating a TopoJSON file from grid based data (GRIB files). I can pretty easily interpolate the data down to a finer resolution grid so…
stewart715
  • 5,120
  • 8
  • 44
  • 78
24
votes
4 answers

topoJSON for congressional districts

Has anyone seen a topoJSON file for U.S. congressional districts? Alternatively, if I can locate the coordinates or a geoJSON file, is it easy to convert to arcs?
Chris Wilson
  • 6,371
  • 8
  • 31
  • 64
23
votes
2 answers

How to Pass geojson array to datatable dyanamically using javascript

I want to pass one geojson file to dynamically created datatable using javascript,I am unable to identify column names in file.. I have tried this.. CODE …
Priyanka
  • 369
  • 2
  • 5
23
votes
2 answers

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

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…
user5325596
  • 2,050
  • 3
  • 18
  • 36
23
votes
2 answers

Draw lines between markers in leaflet

I'm trying to insert lines between markers (which are generated from JSON data) in leaflet. I saw an example, but it doesn't work with JSON data. I can see the markers, but no lines appear. var style = { color: 'red', fillColor: "#ff7800", …
user4131013
  • 365
  • 1
  • 5
  • 14
22
votes
6 answers

Convert geopandas shapely polygon to geojson

I created a circle using geopandas and it returned a shapely polygon: POLYGON: ((...)) I want this same polygon as a geojson object. I ran across this: shapely.geometry.mapping(shapelyObject) which returns this: {'type': 'Polygon', 'coordinates':…
jchaykow
  • 2,136
  • 2
  • 13
  • 36
1
2 3
99 100