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

Create a GeoDataFrame from a GeoJSON object

I have a Feature Collection of polygons and I have to first write it in a temporary file to then load it with geopandas.GeoDataFrame.from_file(tmp_json_file), is there any way to not write the temporary file and to just create the GeoDataFrame from…
kwn
  • 909
  • 2
  • 13
  • 25
16
votes
1 answer

What means "Generic type 'Feature' requires 1 type argument(s)" in Typescript?

I try to use GeoJson in typescript but the compiler throws error for this two variables: Generic type 'Feature' requires 1 type argument(s) const pos = { "type": "Feature", "geometry": { "type": "Point", …
dagatsoin
  • 2,626
  • 6
  • 25
  • 54
16
votes
1 answer

How to read external GeoJSON file from openlayers?

I have to draw some lines by OpenLayers. The line features are coded as GeoJSON format. My code is ok for hard coded GeoJSON features. But, if I put this features in separate file and try to load it. It just does not work. I do not know what is the…
Shahjalal
  • 1,163
  • 7
  • 21
  • 38
15
votes
3 answers

How to set the zIndex layer order for geoJson layers?

I would like to have certain layers to be always on top of others, no matter in which order they are added to the map. I am aware of bringToFront(), but it does not meet my requirements. I would like to set the zIndex dynamically based on…
bob
  • 311
  • 1
  • 3
  • 6
15
votes
2 answers

Order of coordinates in geojson

I was testing rendering of data via GitHub in geojson format, because I wanted to use it for INSPIRE data. INSPIRE data are in GML 3.2.1 format. I've downloaded one of datasets from http://services.cuzk.cz/gml/inspire/cp/epsg-4258/ (which is in…
Meďák
  • 361
  • 1
  • 5
  • 12
15
votes
3 answers

Building a GeoJSON with Python

I want to generate dynamically a geoJSON with a variable number of polygons. Example for 2 polygons: { "type": "FeatureCollection", "features": [ {"geometry": { "type": "GeometryCollection", "geometries": [ …
Roman Rdgz
  • 12,836
  • 41
  • 131
  • 207
14
votes
3 answers

Merging two GEOJSON polygons in Python

Is there a way to merge two overlapping GEOJSON polygons in python, returning a single merged GEOJSON object?
traggatmot
  • 1,423
  • 5
  • 26
  • 51
14
votes
1 answer

Can't extract geo keys' even though the GeoJSON is valid

I have a collection in MongoDB with a 2dsphere index. The object I want to save looks like this: { "type" : "Polygon", "coordinates" : [ [ [ 5.052617929724351, …
Mathyn
  • 2,436
  • 2
  • 21
  • 33
13
votes
4 answers

GDAL, ogr2ogr "Cannot find proj.db" Error

I've tried to extract certain country from the world shp file from natural earth. I am currently using windows 10, so I installed python 3.7, gdal to use the ogr2ogr. I typed the below code in the command to extract the south korea ogr2ogr -f…
Yang JongHyun
  • 133
  • 1
  • 1
  • 6
13
votes
1 answer

can't access 'coordinates' member of geojson feature collection

I have a GeoJSON feature collection in my Angular app that is an array of features, each containing a geometry object and properties object. Structure looks like this: import { FeatureCollection, Feature } from 'geojson'; staticBreadcrumbs:…
cpeddie
  • 759
  • 13
  • 38
13
votes
2 answers

How to create GeometryCollection from geojson with python shapely?

I want to calculate areas of geometries and some of these geometries can be geometry collections. But I can't do this because shapely doesn't create geometry collection from geojson. Here is the sample code: import sys import shapely from…
kz_sergey
  • 677
  • 5
  • 19
13
votes
3 answers

Plot colored polygons with geodataframe in folium

I'm trying to plot radar data in folium, and I'm almost there. I followed this example (Contour plot data (lat,lon,value) within boundaries and export GeoJSON) to get my data into a GeoJson format. nb_class = 20 collec_poly =…
edub
  • 659
  • 4
  • 8
  • 19
13
votes
2 answers

Export leaflet map to geojson

Is it possible to export geojson from leaflet to save the map state? I want to store the markers, zoom & map center to load it later. There is plenty of ways to load geojson on leaflet, but I can't figure out any option to export the map to…
Hugo H
  • 6,029
  • 5
  • 37
  • 57
13
votes
3 answers

Changing the style of each feature in a Leaflet GeoJSON layer

I have been studying the Leaflet Chloropleth example. In my Leaflet application, I have a jQuery dropdown that, when selected, fires a function that takes the name of a state as an argument. I want to use that state name to update the Chloropleth…
Union find
  • 7,759
  • 13
  • 60
  • 111
13
votes
1 answer

leaflet - Looking for method of adding onEachFeature to existing geojson layer

I'm working with geojson data in leaflet. In their guide at http://leafletjs.com/examples/geojson.html they write that there are two ways of adding geojson data to the map: "GeoJSON objects are added to the map through a GeoJSON layer. To create it…
jimutt
  • 667
  • 2
  • 13
  • 29