Questions tagged [geojson]

GeoJSON is a geospatial data interchange format based on JavaScript Object Notation (JSON)

Filter by
Sorted by
Tagged with
24
votes
4answers
35k views

GeoJSON Styling information

As far as I can see there is nothing in the GeoJSON standard to store styling information, i.e. line colours, thicknesses etc. Am I missing something or is this just something that GeoJSON doesn't ...
0
votes
1answer
374 views

How to change the color of GeoJSON layer?

I want to show my road network in red color. How can I change this default color of the road network. Where should I attach style property? var roadNetwork = new L.LayerGroup(); $.getJSON("{% url '...
0
votes
0answers
59 views

Quadtree based polygon indexing? (Python/Java)

I was wondering how to best represent the inside of any given polygon (GeoJSON coordinates) with some sort of indexing, like a grid or quadtree? See image below for an approximation of what I have in ...
16
votes
3answers
14k views

Generating GeoJSON with Python

I want to programmatically create a GeoJSON file using polygons from a shapefile but adding attributes from my own application. This is easily done for a shapefile: def create_data_dayer(self,...
-1
votes
1answer
127 views

Searching Polish districts in JSON

I am looking for a map of polish 'powiaty', eng. 'county' or 'district' (i.e. second-level unit of local government and administration in Poland, equivalent to a county, district or prefecture) in ...
1
vote
1answer
1k views

OpenLayers polygon fill not working with GeoJSON file as source

I'm trying to visualise some data in a custom shape on a map, and I'm stuck with styling it. I'm currently using the openlayers framework in combination with a geoJSON file that I generate in code. I'...
4
votes
4answers
4k views

Representing Time in GeoJSON?

I'm modelling a bus route as a series of waypoints. Most of these waypoints have just a latitude and a longitude and represent points along a road. However, when the bus gets to a bus stop, the ...
0
votes
1answer
57 views

OpenLayers5: GeoJSON: featureProjection vs dataProjection

What's the difference between featureProjection and dataProjection in OpenLayers 5, GeoJSON class?
0
votes
2answers
103 views

Opening GeoJSON in QGIS: projection problem?

I'm attempting to use QGIS to convert a GeoJSON to DXF. The problem is that the GeoJSON import is distorted, with the latitudes compressed. This isn't just a problem with the screen's aspect ratio: ...
0
votes
1answer
460 views

Uncaught TypeError: L.GeoJSON.AJAX is not a constructor

I want to add my json files to leaflet using leaflet-ajax plugin. But it always says following error: Uncaught TypeError: L.GeoJSON.AJAX is not a constructor Why this error is showing in my code? ...
0
votes
1answer
61 views

Searches by area names in OpenLayers with request of AJAX in the PostGIS database

We built a GeoJSON: {"type":"FeatureCollection","features":[{"type":"Feature","id":0,"geometry":{"type":"Polygon","coordinates":[[[669023.843,415221.025],[669031.588,415222.415],[669059.365,415154....
1
vote
2answers
663 views

Reading a GeoJSON via Java GeoTools API issue

I'm trying to read this GeoJSON from this string: { "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry":...
6
votes
0answers
457 views

Why does QGIS 3.4 and higher create .tmp file instead of refresh editing layer after saving?

I downloaded QGIS 3.4.0 and try to save edits in .geojson file. I can save new objects, but not edits in attributes. Insted of it, QGIS creates .tmp file with my chаnges into the same folder with ...
1
vote
2answers
173 views

Mapserver GeoJSON input

Is it possible for MapServer to read GeoJSON file and serve it as a layer in the .map file? Like how it can be done with shapefiles as shown below: LAYER Name 'land' TYPE POLYGON DATA '...
0
votes
1answer
87 views

How to repeat drawing function in Leaflet

I am trying to create a Leaflet.js web map that gives users the opportunity to draw lines. this line will be sent to mapquest elevation API to be retun to the map as a GeoJSON with elevation data ...
5
votes
2answers
2k views

Tiling GeoJSON data?

I have a GeoJSON dataset of the following format (LineString features): { "type": "FeatureCollection", "crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } }, "...
0
votes
1answer
279 views

How to find features in Openlayers VectorTiles

I use MVT vector tiles with Openlayers and everything works fine - but now I have a conceptual problem. I need to make features selectable and searchable. The problem is that there is no way to ...
0
votes
0answers
208 views

Converting L.GeoJSON Leaflet to different projection?

so I have some awesome basemap raster layers that use L.TileLayer to load, but the GeoJSON I have for my country polygons is all Web Mercator. My tile map is WGS84 or EPSG4326 (I think). But I ...
17
votes
5answers
9k views

Polygons and MultiPolygons should follow the right-hand rule

http://geojsonlint.com/ I get error Polygons and MultiPolygons should follow the right-hand rule I used it for past 3 years without any problem with my old geojson file. Now geojsonlint enforce the ...
0
votes
0answers
103 views

Editing attributes of a GeoJSON in Leaflet

I have a map in which I'm trying to create the capabilities of adding new features and editing attributes of new and existing features. I have managed to make the feature editable but I want people to ...
1
vote
1answer
124 views

OpenLayers 5 and GeoJSON with two geometry attributes per feature

I have a GeoJSON file in which each feature has two geometry attributes, one is the default geometry property defined by the GeoJSON standar, and the other one is a property under the standarized ...
0
votes
0answers
51 views

Using QGIS or GRASS API in custom application

I've already read in this link that is not possibile to use QGIS or other GIS application API (GRASS, ArcGIS) without rebuild all libraries into my custom code. First I would like to know if that ...
2
votes
0answers
66 views

Increase the size of overlapping lines in QGIS 3.6

In QGIS I have a layer that is a MultiLineString that has many overlapping lines, which represent driving routes around the city which are generated using OSRM. My data looks something like [ [[a,b],...
0
votes
0answers
15 views

Android laggy map after adding vector objects

I'm using GLMap to render over 5000 vector objects in an Android Application. Here is the framework I'm using: https://getyourmap.com/ Currently, I have Shapefiles which I convert with https://...
0
votes
0answers
24 views

Looping on GeoJSON to get maximum/minimum altitude

I need to create to create 2 function to return max and min Z/elevation/altitude values from LineString GeoJSON file. i have created 2 function to get that before, but i was using MultiLineString ...
1
vote
2answers
150 views

Put a label on OpenLayers from GeoJSON

I have a geojson and I want every property to put a label in its middle with a number .. Here's the function I'm putting on the geojson map: function search(){ var layer = $('#layer').val(); ...
0
votes
0answers
161 views

Creating Leaflet Heatmap using LinsString GeoJSON

I need to create heatmap based on length property from a LineString GeoJSON file. I have tried to use Leaflet.heat plug-in, but this tool accepts points not lines. here is my code: $.getJSON("data/...
0
votes
1answer
266 views

Converting JSON response into a GeoJSON layer in my Leaflet map

I need to convert a JSON response from Mapquest elevation API into a GeoJSON layer in my Leaflet map. var ele = $.getJSON('http://open.mapquestapi.com/elevation/v1/profile?key=<API_KEY>&...
1
vote
1answer
125 views

Leaflet: Different custom information popups for each GeoJSON polygon

I'm really new to this and I'm trying to create popups for 2 polygons which will each contain a paragraph of written information. The function I have so far differentiates between the 2 polygons by ...
0
votes
1answer
41 views

Request a Ajax with GET to remove one or more geometries in OpenLayers

I have a html selection of the form: <table class="table"> <tr> <td> <label>Afiseaza:</label><br /> <select id="layer" onchange=...
0
votes
0answers
88 views

View GeoJSON data after clicking on the OpenLayers map

I'm trying to make a piece of code that when I click on the map to return GeoJSON property data that I clicked on. I tried this way: map.on('click', function(e){ //console.log(evt); //...
0
votes
0answers
63 views

Android Library to convert ESRI Shapefiles to GeoJSON

I'm building an Android App for display ESRI Shapefiles but unfortunately, there are only a few free SDKs which support Shapefiles. Most of them working with GeoJSON, so now I'm looking for an Android ...
0
votes
1answer
40 views

Loading GeoJSON by AJAX method in OpenLayers, centering the map automatically

I'm trying to center the map on the geometries that are on the map. To encompass all but until now I have not succeeded in how ... It centers further than geometries :( if (ol.proj.proj4 &&...
2
votes
1answer
2k views

Using custom icons for Leaflet Layer groups?

I have searched posts and tutorials and could not find the answer to my specific application of this feature Almost all the examples use L.marker to simply place a marker on the map using various ...
0
votes
1answer
215 views

Search plugin of Folium doesn't appear [closed]

I'm trying to reproduce the following jupyter notebook : https://nbviewer.jupyter.org/github/jtbaker/folium/blob/geojsonmarker/examples/plugin-Search.ipynb But once I'm trying to create the map I ...
0
votes
1answer
123 views

Find index of Linestring element at feature, when hovering - openlayers/GeoJson

I have a Geo-JSON Linestring, this is drawn by 800 elements in OpenLayers 4.6.5. I'am trying to use the map.forEachFeatureAtPixel, and print a pop-up when hovering for individual elements on the ...
3
votes
0answers
2k views

from geometrycollection to polygon geometry with python

I have a geojson file containing a feature with geometrycollection type (polygon and linestring). I need to produce two ESRI Shapefile from the geojson geometrycollection: one with Polygon only and a ...
0
votes
0answers
119 views

Leaflet custom icons and popups showing GeoJSON properties with external data?

How can both custom icons and geojson properties be implemented with external geojson in Leaflet? Using methods described in answers to two other questions, both using inline geoJSON: Using custom ...
8
votes
2answers
18k views

Displaying properties of GeoJSON in popup on Leaflet?

This is my simple GeoJSON with Leaflet map. I want to display properties as popup but I don't know why it is empty. Can you tell me my mistake? <html> <head> <title>A Leaflet map!...
1
vote
2answers
133 views

Executing functions after multiple data sources have been loaded in Leaflet AJAX

I have a leaflet map that takes in data from multiple sources via the LeafLet Ajax plugin. I want to execute certain functions only after ALL the data has been loaded, not just one layer. The data ...
1
vote
1answer
81 views

How can I get GeoJSON from Esri software to load in Leaflet?

So I am trying to take a GeoJSON file that I have generated from an Esri shapefile in ArcGIS Pro, but it is not rendering on the map for some reason... The GeoJSON that was created from ArcGIS Pro is ...
0
votes
1answer
377 views

Convert GeoJSON object to bounding box using Python 3.6

Is there a library available in Python 3.6 using which I could convert a GeoJSON object (geometry) into a bounding box object? Actually I am calling a WMS layer from GeoServer and I want to set the ...
1
vote
2answers
75 views

Getting hightest and lowest points

I have GeoJSON files that contains altitude values. I have used these GeoJSON files to be shown on leaflet.js web map. I need to show values of highest and lowest point in two divs when I clicking on ...
0
votes
0answers
100 views

Getting Details of POI

I am pretty new with this so please bear with me. I am able to extract GeoJSON data from OSM and Load it into MongoDB. I am able to run queries to get the data based on Radius. The data looks ...
1
vote
1answer
156 views

CORS issue loading an external local GeoJSON into OpenLlayers 5

I have a local folder on my network with my HTML file and two subfolders, one with the downloaded folder from OpenLayers (renamed ol) and the other with my GeoJSON file (data). When I try to load the ...
3
votes
2answers
1k views

Querying PostgreSQL with GIS to get GeoJSON for GeoJSON tile layer?

I have a PostgreSQL database with one table like the following: CREATE TABLE post_pl ( gid serial NOT NULL, zip character varying(5), zip_n integer, city character varying(50), geom ...
2
votes
3answers
948 views

I'm trying to add my local GeoJSON files to my Leaflet web page

I'm quite new to JavaScript and I have been trying to add my GeoJSON files to a web page. I can't seem to figure out how to get the GeoJSON to actually load. I've checked it using GeoJson.io and it ...
0
votes
1answer
209 views

Is it possible to use SELECT ST_GeomFromText( with other SELECT? [closed]

I'm trying to use SELECT ST_GeomFromText() with a value catched from another query: SELECT ST_GeomFromText( ST_AsText( ST_GeomFromGeoJSON( SELECT column-name FROM table-name ORDER BY ...
1
vote
2answers
839 views

Create Polygon with Length, Width, and a center coordinate

Using Shapely or like library, How can I create a rectangular polygon with known Length, Width (in meters)(Drawing over EPSG: 3857), and center coordinates (EPSG: 4326)? The output needs to be in ...
1
vote
1answer
429 views

Converting GeoJSON to shapefile using GeoTools Java

I am implementing a web service in Java which takes a GeoJSON file as input and converts it into a shapefile. My code looks something like this :- @RequestMapping(value = "/uploadFile", method = ...