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
10
votes
3 answers

Show large geojson file in android google maps

I am trying to show a geojson layer to Google Map. The code is as follows. The geojson file is stored locally in my raw folder. The file has 286 features (around 15MB). Hence, reading this file and displaying it is consuming more time. Initially, I…
Sujal
  • 1,447
  • 19
  • 34
10
votes
1 answer

Enlarge a GeoJSON polygon

How to enlarge a GeoJSON polygon ? Say I have a GeoJSON polygon I'd like to enlarge this shape to have a larger polygon with the same basis I did not found anything on the web about this. I found many promising libraries such as turf.js, but…
Cyril CHAPON
  • 3,556
  • 4
  • 22
  • 40
10
votes
2 answers

Converting GeoJSON response to FeatureCollection

Hi I am trying to parse the response from a OSM webservice into feature collection using GeoJson.Net I am new to GeoJSON and not able to identify how to do so: The Json response can be find here. The code I have written is: System.IO.StreamReader…
Mohit Vashistha
  • 1,824
  • 3
  • 22
  • 49
10
votes
4 answers

Google maps v3 data.feature Editable?

I have polygons loaded using method map.data.loadGeoJson('geo.json',{ idPropertyName: 'ID' }); Now I want to make editable one of loaded from geojson polygons. I was tried: map.data.getFeatureById(1).setProperty('editable', true); But it seems…
seek
  • 1,065
  • 16
  • 33
10
votes
1 answer

Suggestions on how to create a custom GeoJson serializer using JSON.NET?

I will be attempting to create a C# library to serialize objects to GeoJSON using Json.NET ( for serialization ) and GeoAPI.NET ( for geometry definitions ). I have thought about two different approaches for the serialization implementation and I…
Ryan Taylor
  • 8,740
  • 15
  • 65
  • 98
10
votes
6 answers

Store GeoJSON polygons in MongoDB

I have the following problem with MongoDB. I got some geo data from my home country and i have to store them into mongodb to set up a simple Web Feature Service. This service will mostly do bounding box queries using the $within operator. The data…
Dominik Nöger
  • 103
  • 1
  • 1
  • 5
9
votes
1 answer

Read GeoJSON file using SF library?

I just started to use R a day ago and I'm trying to read a geojson file using the SF library, but I'm not sure what the correct way is. library(dplyr) library(sf) geo <- system.file('/my/path/zones.geojson', package = 'sf') st_read(geo) When I run…
code_learner93
  • 571
  • 5
  • 12
9
votes
2 answers

How can I invert a GeoJson-Polygon

Ho can I invert a GeoJson of a country, so that it defines the country as a hole in the polygon of the worldmap? I need this to create a mask of the GeoJson VectorLayer in OpenLayers 5.3.
Meiko Rachimow
  • 4,664
  • 2
  • 25
  • 43
9
votes
4 answers

Leaflet remove GeoJSON layer(s)

I'm coloring areas on the map by creating GeoJSON layers in leaflet. First I create an empty layer: var layerPostalcodes=L.geoJSON().addTo(map); Then I create a geojson element containing the shape information and add it to the…
Ilse
  • 329
  • 2
  • 6
  • 12
9
votes
1 answer

How to fix geojson to satisfy the needs of a mongodb 2dsphere index

I have ~400K documents in a mongo collection, all with geometry of type:Polygon. It is not possible to add a 2dsphere index to the data as it currently stands because the geometry apparently has self-intersections. In the past we had a hacky…
dan-man
  • 2,949
  • 2
  • 25
  • 44
9
votes
1 answer

Mapbox GL JS : Changing polygon border width

I have a simple polygon on a map and I would just like to adjust the border color width. (geoJSON is external) I was unable to find this in the API manual. This is a link to my example (and source). Currently my code for styling the polygon…
David
  • 605
  • 2
  • 14
  • 44
9
votes
2 answers

How to display label on mapbox map polygon with GeoJSON

I want to display a custom label on mapbox map using GeoJSON data, I have added name under feature properties with a color which I want to show as polygon fill color for a zone, I have no Idea how to do it, I have searced a lot but found nothing on…
Saqueib
  • 3,484
  • 3
  • 33
  • 56
9
votes
1 answer

MongoDB $geoIntersects not finding one fully-contained line in polygon, but finding another

I have a MongoDB database that has a collection called fooCollection. This collection has documents in it containing geospatial data in the way of a bounding polygon. I am using the C# MongoDB driver in my app. I noticed that it was not finding…
08Dc91wk
  • 4,254
  • 8
  • 34
  • 67
9
votes
2 answers

How to make a GeometryCollection in GeoJSON with a single point + polygon?

How do you add a point to a polygon as a single feature? According to the GeoJson specs, this is known as a "GeometryCollection". Example of a 'GeometryCollection': { "type": "GeometryCollection", "geometries": [ { "type": "Point", …
redshift
  • 4,815
  • 13
  • 75
  • 138
9
votes
1 answer

Django's GeoJSON serializer not serializing all fields?

I'm using Django 1.8, with GeoDjango and PostGIS. I am using HttpResponse to return some GeoJSON: from django.http import HttpResponse, JsonResponse code = request.GET.get('q', '') results = PCT.objects.filter(Q(code__startswith=code) | …
Richard
  • 62,943
  • 126
  • 334
  • 542