8
votes
Accepted
Unable to remove GeoJSON features/layer in Leaflet
One way of solving this problem would be to declare geojson variable global outside getParkingLots function. Then layer has to be created only the first time, and from then on it just has to be ...
- 20.7k
5
votes
Accepted
Create layer from an array of geometries in OpenLayers?
You will need an array of features, not just geometries. Create features containing the identifying properties of each ope, then read the geometry into OpenLayers format and set it in the feature. ...
- 11.5k
5
votes
Accepted
Crossing lines when displaying multilinestring from GeoJSON in Leaflet
I managed to partly resolve the mystery of GeoJSON returned by WFS service. There are still some coordinates missing, but that's probably consequence of some configuration error on GeoServer.
First I ...
- 20.7k
4
votes
Accepted
Convert ESRI JS Graphic geometry into WKT format
You can use arcgis-to-geojson-utils library (see https://github.com/Esri/arcgis-to-geojson-utils) to convert ESRI JSON to GeoJSON, and then terraformer/wkt library (see https://github.com/terraformer-...
- 20.7k
2
votes
Accepted
PHP library to get center of the polygon center
GeoPHP is a popular extension for geospatial manipulation and had a centroid method for what you want to do.
- 503
2
votes
Accepted
Get GeoJSON feature from a promise response in OpenLayers?
Your JSON is not GeoJSON, but it has geometry that corresponds to GeoJSON standard, so you can use .readGeometry method to read it.
Code could then look something like this:
const feature = new ol....
- 20.7k
2
votes
Accepted
Shapely import and to_geojson()
What is your shapely version ?
With version 2.x
import shapely
shapely.__version__
'2.0.1'
from shapely.geometry import LineString, mapping
line = LineString([(2, 0), (2, 4), (3, 4)])
shapely....
- 53.4k
2
votes
Shapely import and to_geojson()
Here goes a simple conversion example
import geojson
import shapely.wkt
# sample linestring
linestring = shapely.wkt.loads("LINESTRING(0 0, 1 1, 2 2, 3 3, 4 4, 5 5, 6 6, 7 7, 8 8, 9 9, 10 10)&...
- 656
1
vote
ogr2ogr merge two GeoJSON to one GeoJSON
You can also merge GeoJSON files using a JSON processing command line tool such as jq.
jq '{"type": "FeatureCollection", "features": [.[] | .features[]]}' --slurp input*....
- 171
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
geojson × 2524leaflet × 730
javascript × 307
openlayers × 248
python × 213
qgis × 202
postgis × 171
json × 141
shapefile × 140
ogr2ogr × 127
openlayers-2 × 116
coordinate-system × 94
mapbox × 87
polygon × 86
geoserver × 84
openstreetmap × 73
gdal × 70
postgresql × 69
convert × 65
geopandas × 52
wfs × 50
markers × 43
layers × 41
php × 41
topojson × 41