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
7
votes
1 answer

How do I update content in a Leaflet popup?

I'm working with Wax with Leaflet. I'm setting up a map of the US, drawing state boundaries with GeoJSON using leaflet's L.GeoJSON. I'm able to get everything set during the map load, but I need to be able to adjust the content in the popups after…
Mike Shultz
  • 1,368
  • 1
  • 15
  • 32
7
votes
1 answer

Adding and displaying data from a locally stored GeoJSON file using MapBox

I'm attempting to add markers to a map from a GeoJSON File that has been added to the "asset" folder. I've attempted to follow the documentation however have been unable to get the expected result since the markers are no where to be found when…
Enigmatic
  • 3,902
  • 6
  • 26
  • 48
7
votes
1 answer

how to determine if a point is inside a polygon using geojson and shapely

I am hoping to create a region on a map and be able to automatically determine if points (coordinates) are inside that region. I'm using a geojson file of the entire US and coordinates for New York City for this example. Geojson:…
Josh
  • 239
  • 3
  • 6
7
votes
2 answers

Get coordinates of geogson feature in Mapbox

A GeoJson feature looks like this : { "type": "Feature", "properties": {}, "geometry": { "type": "Point", "coordinates": [ 43.59375, 59.17592824927136 ] } } In Mapbox using Java/JVM we can construct the feature like…
erluxman
  • 18,155
  • 20
  • 92
  • 126
7
votes
1 answer

Leaflet - import Geojson - Angular 6

i try to import GeoJson file to leaflet in angular's app 6. With this solution my geojson is drawn in leafletmap but i have this error and i can't build my app. Someone know one solution ? ERROR TS2345 Argument of type '{"type":…
al NTM
  • 247
  • 5
  • 15
7
votes
1 answer

D3: hide voronoi strokes that fall 'in the sea'

What would be the least 'expensive' way to hide all voronoi strokes that fall in the sea? The strokes (and polygon fill) that run on land should be visible, whilst those that are on sea should be hidden from view. I think my objective should be…
Noobster
  • 1,024
  • 1
  • 13
  • 28
7
votes
3 answers

Convert Geo json with nested lists to pandas dataframe

I've a massive geo json in this form: {'features': [{'properties': {'MARKET': 'Albany', 'geometry': {'coordinates': [[[-74.264948, 42.419877, 0], [-74.262041, 42.425856, 0], [-74.261175, 42.427631, 0], [-74.260384,…
skrubber
  • 1,095
  • 1
  • 9
  • 18
7
votes
1 answer

How to drag a polygon in the same fashion as the dragging a point mapbox-gl-js example?

I have a geojson polygon adding to the map with the click of a button. I also have the style of the polygon changing on the mousedown event on the geojson and the x/y coord pairs (the geojson geometry) printing to the console accessing it through…
7
votes
1 answer

Why won't serialize capture annotate fields?

I had no idea adding data to a queryset would be so hard. It's like, if it didn't come directly from the db then it might as well not exist. Even when I annotate, the new fields are 2nd class citizens and aren't always available. Why won't serialize…
Openmic
  • 227
  • 2
  • 12
7
votes
2 answers

Google map does not display correctly in jupyter notebook

I'm trying to use google map API to visualize some data in jupyter notebook. Here is the code I used to display basic map in jupyter: import gmaps import os import json import…
Zhenyu Bo
  • 171
  • 1
  • 2
  • 5
7
votes
3 answers

GeoJSON data not displaying in Python folium map

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…
vkc
  • 556
  • 2
  • 8
  • 18
7
votes
4 answers

Decoding Google Maps API Encoded Overview Polyline with Javascript for use in Mapbox

Have been searching for various JS functions that can decode an encoded polyline to a geoJSON string, and all that I try come up with really odd lat,lng points. Usually starting in the correct location but then wandering way off course. Here's one…
Neil Simpson
  • 197
  • 1
  • 3
  • 10
7
votes
3 answers

How to convert data from PostGIS database into GeoJSON in Java

I have a PostgreSQL/PostGIS database and I want to convert my data table from database into GeoJSON format. My purpose is to use this GeoJSON for creating a map with JavaScript. I am using Java and JDBC in Spring MVC. What is the best way to convert…
jack
  • 521
  • 2
  • 6
  • 9
7
votes
2 answers

Leaflet-Draw: Get polygon latLng in 'draw:editvertex' event

When a draw:editvertex event fires, how can I get information about the polygon which triggered it? this.map.on('draw:editvertex', function (e) { debugger; var layers = e.layers; // I want to get current polygon latLng here }.bind(this));
Kalashir
  • 1,099
  • 4
  • 15
  • 38
7
votes
1 answer

Adding custom markers to the mapbox gl

I would like to add a custom marker to my map. I am using a mapbox gl script. The only documentation that I found related to this topic is this one https://www.mapbox.com/mapbox-gl-js/example/geojson-markers/. I tried to customize given example…
Aiwatko
  • 385
  • 2
  • 6
  • 17