Hot answers tagged

4

I don't think you can do it directly with select, but you can use -sql instead of -select to reference a column/property with spaces in the name: ogr2ogr -sql 'SELECT "My Property" FROM layername' -f 'Esri Shapefile' my-shp-dir my-fc.json


2

TurfJS just fails to calculate intersections with highly-detailed geometries - internally, it will truncate the precision of the geometries' coordinates to about 6 decimal digits. A bit of digging uncovers that there's some discussion about the issue at https://github.com/Turfjs/turf/issues/1118 . There are deeper concerns here because the underlying code ...


2

The concept you are describing is what's known as a "spatial join". If you're open to using geopandas, the sjoin function accomplishes this easily: import geopandas as gpd constituencies = gpd.read_file('constituencies.geojson') provinces = gpd.read_file('provinces.geojson') join = gpd.sjoin(constituencies, provinces, how='inner', op='within'...


2

Since GeoJSON layer is actually a group layer consisting of individual layers representing features, it's possible to add individual feature layer to the map, it just has to be identified by some id. When clicking on the feature of the layer_tt2_0 layer, corresponding feature from the layer_tt1_1 is found with the help of group layer .eachLayer method, ...


2

This indeed was not a standard geojson. However the coordinates and attributes were easy to reconfigure to geojson format. you can use this short script to load this data into qgis or save to a file if you enter a valid output folder on your machine. from requests import get import json url = 'https://carrollcova.mapgeo.io/api/ui/datasets/properties/77-A-...


1

Unlike the ogr2ogr command line tool, the ogr2ogr npm module automatically zips shapefiles. I forked the library and updated the 'ESRI Shapefile' entry in drivers.json, so that the output property has a value of "". This stops the npm module from zipping the directory, and the output is the shapefile directory.


1

I would go this way, tell me if this fits your needs: import pandas as pd import geopandas as gpd from shapely.geometry import Point, LineString feat = { "type": "Feature", "id": 0, "properties": { "FID": 0, "prop1": 1, "prop2": "thing2", "prop3": "thing3" }, "geometry": { "type": "LineString", ...


1

In your original code you should change loader: to url: as the function doesn't load features, it simply returns a url with bbox parameter var signaletiqueSource = new ol.source.Vector({ //source signaletique WFS format: new ol.format.GeoJSON(), url: function(extent) { return 'http://localhost/cgi-bin/mapserv....


1

I found the solution if it can help someone. var signaletiqueSource = new ol.source.Vector({ //source signaletique WFS format: new ol.format.GeoJSON(), url:'http://localhost/cgi-bin/mapserv.exe?map=C:/ms4w/Apache/htdocs/mapfile_rando.map&SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&TYPENAME=signaletique&...


1

The geometry in the GeoJSON is not valid. "type": "MultiPolygon", "coordinates": [ [ 6.334986208752899, 50.62066998876687 ], [ 6.334986208752899, 50.59616998876687 ], [ 6.2952362087528995, 50.62066998876687 ], ...


1

If you need library on Python: osm2geojson Example import codecs import osm2geojson with codecs.open('file.osm', 'r', encoding='utf-8') as data: xml = data.read() geojson = osm2geojson.xml2geojson(xml) # >> { "type": "FeatureCollection", "features": [ ... ] }


Only top voted, non community-wiki answers of a minimum length are eligible