9
votes
Accepted
Make polygon of GeoJSON layer unclickable after first click in Leaflet
One possible solution would be to use some custom polygon/layer property, like for example wasClicked (name can be any, as long is does not conflict with standard Leaflet layer properties), to mark ...
8
votes
Accepted
Does GeoJSON not support different projections?
The obsolete GeoJSON 2008 specification has a "crs" member to define a coordinate reference system (including projected).
GDAL/OGR has a RFC7946 layer creation option, with default NO (thus ...
8
votes
GeoJSON format to CSV
This particular GeoJSON has a list of nested dictionaries as one of its properties. The following script downloads the GeoJSON, creates a point layer which is added to the map canvas, and extracts the ...
7
votes
Fetching the on-click data from the website into QGIS
In eclipsewise.com, the pop-up window's id is mapmaker. So, you can use the same JavaScript code in the same way. The script copies the pop-op content to the clipboard.
function copyToClipboard(text) {...
6
votes
Accepted
Converting ArcGIS Spatially Enabled Dataframe to GeoJSON
Neither the API documentation nor dir(pd.DataFrame.spatial) has any indication that there is a to_geojson() method. So there is no direct way to do this as far as I know.
However, instead of using ...
6
votes
GeoJSON API in QGIS
WMS is a protocol for image data (such as a PNG or JPEG). To directly access a GeoJSON via a URL you can use the Add Vector Layer dialog (Layer -> Add Layer -> Add Vector Layer...). Set the ...
6
votes
Accepted
Convert GeoJSON geometry to new coordinate system and WKB format in python
The coordinate system of GeoJSON may be EPSG:3857. You can use the following script
import json
import shapely
from shapely import wkb, wkt
from shapely.geometry import LineString
# Opening JSON file
...
5
votes
Fetching the on-click data from the website into QGIS
This is a new answer with the new websites.
Procedure :
Go on the desired eclipse site on http://xjubier.free.fr, for example
View the source of the webpage (right-click on the eclipse marker data ...
5
votes
Accepted
Extracting the space between polygons
Try unary_union to dissolve all obstacles to a big multipolygon. Then create a rectangle around the multipolygon and difference:
import geopandas as gpd
df = gpd.read_file(r'C:\GIS\data\tempdata\my....
5
votes
Accepted
GeoJSON will load from variable, but not from file in OpenLayers
When used in a Vector source the GeoJSON parser will attempt to transform coordinates from the default data projection for GeoJSONs (CRS:84) to the view projection. As your coordinates are already in ...
5
votes
Accepted
GeoJSON AttributeError('str' object has no attribute '_geom') - when converting to WKB format
You convert the geometry dict to string using json.dumps and pass the string to wkb.dumps() method. But it requires a shapely geometry. Therefore, you get 'str' object has no attribute '_geom' error. ...
4
votes
Is it possible to get OSM data in geojson via overpass api using ipython?
It is possible now to retrieve a GeoJSON object of OSM relation with Overpass convert function, here is an example:
[out:json];
( way(51.477,-0.001,51.478,0.001)[name="Blackheath Avenue"];
...
4
votes
Accepted
Updating the filter option for GeoJSON layer in Leaflet?
If you look at the Leaflet docs for GeoJSON layer at https://leafletjs.com/reference-1.7.1.html#geojson, you'll notice the following note for filter option:
Note: dynamically changing the filter ...
4
votes
Accepted
QGIS attributes table shows wrong data when printing Timestamp with Milliseconds
In the first case, QGIS adds the values as QTime objects and convert milliseconds to zeros. I don't know why.
In the second case (d case), QGIS adds the values as string. Everything is as it should ...
4
votes
Accepted
How to create an empty GeoJSON template with several empty fields (QGIS)
You can save this on your disk and edit the field names with any text editor
{
"type": "FeatureCollection",
"name": "jsontemplate",
"features": [
{ &...
4
votes
Accepted
Dataframe object is not callable
As @user2856 stated, sample is a DataFrame, not a function, you can't call it. That's, you cannot use it with parenthesis, like sample(.
Other problems arise because the whitespaces consist of tabs ...
4
votes
Access GeoJSON feature keys using Python
(1) In Example 1, it is normal you to get keys ['type', 'features'] because title in for title in data gives you a key of data.
(2) data["features"] is a list and you have to specify index ...
4
votes
Accepted
Populating all the data from GeoJSON to an HTML div
That's because you set $("graphs").html() to each element in turn, overwriting the previous content.
Use $("graphs").append(content);, that should retain the previous content, or ...
3
votes
Accepted
Leaflet artifact on GeoJSON hexgrid without borders at zoom 10
It seems like some kind of a bug. I didn't go into details why this happens, just found a workaround with modifying style.
Instead of stroke weight 0, it gets weight 1. Since polygons overlap, this ...
3
votes
Accepted
ogr2ogr download GeoJSON from URL with parameters
You will find a working sample code below to directly get the data from the URL and push it to a PostGIS table (I've considered you already have an existing database and ran CREATE EXTENSION postgis;
...
3
votes
Find turns in GPS coordinates
Here's how it can be achieved using QGIS:
Convert the file to a geopackage (line geometry) using QGIS.
Remove unnecessary fields (they can slow down further processing).
Set the correct coordinate ...
3
votes
Accepted
Upload GeoJSON files to ArcGIS Online content
This Esri Community question contains the answer.
To summarize (since the final solution is spread out over multiple answers):
from arcgis.gis import GIS
data_path = r'C:\path\example.geojson'
gis = ...
3
votes
Adding vector layer feature from REST API URL (HTTPS) in QGIS
It may be convenient to use a VRT file if you often use the same remote layer in different QGIS projects instead of copying/pasting it in each of them.
Put in file myvrt_demo.vrt the following content ...
3
votes
Accepted
Something wrong with GeoJSON for LineString
You have 3 levels of nesting in your coordinates which is not right for a simple linestring.
Either make it a MultiLineString
{
"type": "FeatureCollection",
"features&...
3
votes
Accepted
Extracting skatepark data as JSON file
Use Overpass Turbo web interface, zoom to your region of interest, click Wizard and enter this string: sport:skate or sport:extreme.
Using double points : instead of equal symbol =, it uses wildcards (...
3
votes
Accepted
Does Geometry by expression in QGIS except layer without geometry?
The problem
The problem with your expression is that you apply it on the Matrix layer, but this is a layer without geometry. Creating geometries works only on layers that contain geomtries. It does ...
3
votes
Changing GeoJSON key name
Your input GeoJSON is invalid (copy paste it in https://geojsonlint.com). You can't expect a valid GeoJSON output from a bad input. So, first, you should replace all single quotes with double quotes. ...
3
votes
Accepted
Dynamically fetching only related values instead of all attribute values in dropdown from GeoJSON in OpenLayers
There are a few things you have to do to make it work:
Set variable featureNames with all the travel relations as global, so it will be available for filtering To Station when From Station is ...
3
votes
Make polygon of GeoJSON layer unclickable after first click in Leaflet
I see (at least) four ways of achieving this, none of them being really clean:
The (default) L.SVG vector renderer applies the interactive option only when a vector is added to the renderer. Thus, ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
geojson × 2409leaflet × 701
javascript × 299
openlayers × 235
python × 191
qgis × 190
postgis × 166
shapefile × 136
json × 136
openlayers-2 × 116
ogr2ogr × 110
coordinate-system × 92
geoserver × 81
mapbox × 81
polygon × 80
openstreetmap × 67
postgresql × 66
gdal × 65
convert × 62
wfs × 47
geopandas × 44
layers × 41
markers × 41
d3 × 41
topojson × 41