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 :

4307 questions
13
votes
3 answers

Emulate click on leaflet map item

Having the Leaflet Choropleth tutorial i have to emulate a click event on a specific map area. For example: i have to have a function like clickOnMapItem(itemId) that will click on a map area which is defined by the following…
Ostap Koziy
  • 167
  • 1
  • 2
  • 9
12
votes
2 answers

leaflet js: draw POIs as canvas

I want to draw many geo points with Leaflet. Therefore I want to use HTML5 canvas to improve the performance. My datasoure is geoJSON. As I saw in the documention of Leaflet, it is not possible to draw the geo positions as canvas yet. var…
Andrew
  • 387
  • 2
  • 4
  • 10
12
votes
3 answers

Transform GeoJSON to SVG with Javascript

Is there a ready-to-use Javascript plugin that thansforms a GeoJSON string into a SVG string? A rendering engine, as Tempo, or the project JsonT would be useful, but I need the template to make them works.
camilokawerin
  • 401
  • 1
  • 3
  • 14
12
votes
3 answers

how to convert geojson to shapely polygon?

i have a geoJSON geo = {'type': 'Polygon', 'coordinates': [[[23.08437310100004, 53.15448536100007], [23.08459767900007, 53.15448536100007], [23.08594514600003, 53.153587050000056], (...) [23.08437310100004, 53.15448536100007]]]} and i…
adamDud
  • 309
  • 1
  • 3
  • 10
12
votes
2 answers

How can I make a map using GeoJSON data in Altair?

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.topo_feature(data.us_10m.url,…
Jonathan
  • 10,571
  • 13
  • 67
  • 103
12
votes
2 answers

Set color for missing values in folium choropleth

I have a dataframe with some countries and variables and I would like to produce a choropleth map with folium, using a geojson file for the entire world. I have a problem with folium assigning maximum value on a color scale to countries that are not…
pieca
  • 2,463
  • 1
  • 16
  • 34
12
votes
1 answer

Android Google Maps GeoJson, how to tint the whole map one color

I'm currently working with the Android Google Maps utility library. I receive geojson of a given area via an API call and need to display this area on the map. I do so by calling GeoJsonLayer layer = new GeoJsonLayer(getMap(),…
12
votes
2 answers

Scaling d3 v4 map to fit SVG (or at all)

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").append("svg") .attr("width", 1000) …
Jason Blevins
  • 125
  • 1
  • 6
12
votes
2 answers

What's the difference between LineString and Multipoint in GeoJSON

What's the difference between LineString and MultiPoint in GeoJSON? To me the examples given are identical. http://geojson.org/geojson-spec.html#id3. I'm planning some things in GeoJSON and if something as basic as this is confusing I'm in trouble.
Greg
  • 2,359
  • 5
  • 22
  • 35
12
votes
4 answers

Spatial Datatype (geometry) to GeoJSON

I want to convert geom (geometry) datatype to GeoJSON. How could I do that? For example, the geometry in WKT: POLYGON((455216.346127297 4288433.28426224,455203.386722146 4288427.76317716,455207.791765017 4288417.51116228,455220.784166744…
12
votes
2 answers

Downloading GeoJSON boundaries using SPARQL from publicly available data

I'm interested in downloading some boundary files from statistics.gov.scot, which is an official statistical repository for sharing statistical data that utilises SPARQL queries. Background Statistics.gov.scot provides access to GeoJSON boundaries…
Konrad
  • 17,740
  • 16
  • 106
  • 167
12
votes
3 answers

How to display vector tiles generated by geojson-vt in leaflet?

I have a lot of GeoJSON spatial data that I want to display on a leaflet map. Around 35,000 GeoJSON objects. Because the amount of points can get very large, I wanted to use the geojson-vt library to tile my data on the client side. Right now I have…
Røye
  • 1,077
  • 3
  • 14
  • 27
12
votes
2 answers

Display GeoJSON with leaflet that spans the 180th meridian

I am trying to display a geoJSON object (outline of Russia, in this case) that spans the 180th meridian. Currently this displays with part of the country on the left side of the map and part on the right: Looking at leaflet, it seems there is a fix…
Rob
  • 7,377
  • 7
  • 36
  • 38
12
votes
1 answer

Problems converting from shape to topojson

I'm trying to convert a shapefile of mexican municipalities into a topojson and displaying it using d3.js using this tutorial http://bost.ocks.org/mike/map/#converting-data. I've managed to convert it but I can't manage to display it. Any help will…
eclark
  • 819
  • 7
  • 16
12
votes
2 answers

How to retrieve LayerPoint (X, Y) from Latitude and Longitude coordinates using Leaflet API

If I use the following code to get the LayerPoint from a specified Lat/Lng: var latLng = new L.latLng(-37.81303878836989, 144.97421264648438); var point = map.latLngToLayerPoint(latLng); The output is the following: o.Point x: 86042 y:…
gotnull
  • 26,454
  • 22
  • 137
  • 203