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

Leaflet: Circle behaving different from CircleMarker

In the documentation for Leaflet here: http://leafletjs.com/reference-1.2.0.html#circlemarker it says that CircleMaker extends Circle, and that it is the same thing, except the radius is specified in pixels rather than in meters, so that the circles…
Agrajag
  • 1,016
  • 2
  • 9
  • 24
6
votes
2 answers

OpenLayers, and GeoJSON, not multiply marker on same coordinates

My code is showing markers from GeoJSON, when I'm haved zoomed into zoom-level 10,it load the GeoJSON-file, but how do I avoid to reput out the same markers? Is there a way to check if there already exist a marker on a specific place? The…
Max Allan
  • 640
  • 5
  • 18
6
votes
1 answer

Calculate centroid of entire GeoDataFrame of points

I would like to import some waypoints/markers from a geojson file. Then determine the centroid of all of the points. My code calculates the centroid of each point not the centroid of all points in the series. How do I calculate the centroid of all…
user3439702
  • 345
  • 3
  • 10
6
votes
2 answers

How to discriminate unions with generics?

I am struggling to automatically infer the type of different kind of items based on their geometry (in the context of displaying some GeoJSON data). I am using a generic types, therefore I did not manage to set a custom typeguards, since it would…
Eric Burel
  • 3,790
  • 2
  • 35
  • 56
6
votes
2 answers

How to drag a polygon in mapbox-gl-js?

I have a map with multiple polygons. The polygons need to move/update on user click/drag. The functionality I want is the same as this example: https://www.mapbox.com/mapbox-gl-js/example/drag-a-point/ I want to make the polygon draggable like the…
N Altun
  • 95
  • 1
  • 2
  • 9
6
votes
4 answers

How to convert shapefile/geojson to hexagons using uber h3 in python?

I want to create hexagons on my geographic map and want to preserve the digital boundary specified by the shapefile/geojson as well. How do I do it using uber's h3 python library? I'm new to shapefiles or any other geographic data structures. I'm…
lipika sharma
  • 61
  • 1
  • 3
6
votes
2 answers

Google Maps - addGeoJson is not working for my file

addGeoJson is not working in google map for my file please check below code that I am using in javascript //create the map map = new google.maps.Map(document.getElementById('map-canvas'), { zoom: 6, center: {lat:49.79, lng: -8.82} }); //…
6
votes
1 answer

how to change folium/geojson color

i wish make it different color in different layer, so use the style_function as i googled like below: style1 = {'fillColor': '#228B22', 'lineColor': '#228B22'} style2 = {'fillColor': '#00FFFFFF', 'lineColor':…
Doeiqw Dwe
  • 143
  • 2
  • 2
  • 5
6
votes
1 answer

Chloropleth map with geojson and ggplot2

I am trying to map Human Poverty Index for various districts of Nepal with choropleth map in R using geojson and ggplot2. I read geojson data for Nepal with districts from here. I saw some examples here, here. This is what I did: # Read geojson…
Suman Khanal
  • 3,079
  • 1
  • 17
  • 29
6
votes
2 answers

OpenLayers 4 - fit to extent of selected features

Me again. So, yesterday I faced a bit of a problem with zooming to selected features and I'm hoping that some of you can push me in right direction.Here it goes... I'm trying to implement autocomplete/search bar using Materialize Materialize…
Svinjica
  • 2,389
  • 2
  • 37
  • 66
6
votes
2 answers

Insert/Update PostGis Geometry with Sequelize ORM

I have extracted models of some PostGis layers with sequelize-auto, giving: module.exports = function(sequelize, DataTypes) { return sequelize.define('table', { id: { type: DataTypes.INTEGER, allowNull: false, primaryKey: true, …
minisaurus
  • 1,099
  • 4
  • 17
  • 30
6
votes
3 answers

Subsetting geojson data with R

I have a geojson file of state boundaries that I obtained from here. In particular I'm using the 20m US States Data I'm trying to subset the data so that I can use leaflet to map only certain states. I can subset a single state using: states <-…
Kactus
  • 142
  • 1
  • 11
6
votes
1 answer

Feature click listener issue android GeoJsonLayer

Hello I'm working with google map android api and I'm using google maps android geojson utility. I'm adding 3 layers of geojson into the map only the road_layer(LineString) have feature click event. The click event is working fine until I'm adding…
Arpan
  • 596
  • 2
  • 10
  • 29
6
votes
1 answer

Joining GeoJSON to another GeoJSON

I have some geographic boundaries that I have a GeoJSON endpoint for. I also have some variables that are stored at a separate GeoJSON endpoint which does not have coordinates, but does have the variable that I want to later thematically style a…
jakc
  • 1,161
  • 3
  • 15
  • 42
6
votes
2 answers

How can I flatten a foreignkey object with django-rest-framework-(gis)

I have searched long and far for a solution that is up to date and specific to my problem but have yet not found a solution or a clear documentation on what I really need to do in order to flatten a relationship to become geojson compliant. This…