New answers tagged ogr2ogr
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
3
votes
Ogr2Ogr appending duplicate records (2X Times) to PostgreSQL Table
Switch -append is adding new features into the table. If you already had a table with 3620 rows then the result is expected. If the table was empty then the result is strange.
If you want to replace ...
- 58.9k
1
vote
ogr2ogr: Make polygon from points
You can also read your .csv file with GDAL directly without editing it. Just read the documentation https://gdal.org/drivers/vector/csv.html and use the syntax like
ogrinfo concave.csv -al -oo ...
- 58.9k
0
votes
Convert gpkg to OSM using ogr2ogr
Ogr2ogr is not capable of converting to osm, you need to use another tool like for example ogr2osm. It expects at least the input file as parameter, in your case that will be the .gpkg file in stead ...
- 1
0
votes
Setting top-level GeoJSON id using ogr2ogr?
This works with GDAL 3.6.2. Attribute "attributefid" is first selected as name "foobar" and consumed as a GeoJSON id, and then it gets selected again with * and placed into GeoJSON ...
- 58.9k
0
votes
Importing GeoJson data to postgresql using ogr2ogr command
Your data are valid JSON but not valid GeoJSON. You can test yourself by pasting this into https://geojsonlint.com
{ "type": "FeatureCollection", "properties": {
"...
- 58.9k
0
votes
Using ogr2ogr in Python scripts
This is how I did it (for fgb):
from osgeo import gdal
shpin = 'shpin.shp'
gdal.UseExceptions()
src_shp = gdal.OpenEx(shpin)
ds=gdal.VectorTranslate(
'abc.fgb',
src_shp,
options='-f "FlatGeobuf&...
- 101
1
vote
Correct syntax for specifying multiple Layer Creation Options in ogr2ogr
I made a test with GDAL 3.6.2 and the syntax that you used works for me. I used this GeoJSON as source data:
{
"type": "FeatureCollection",
"features": [
{ "type&...
- 58.9k
2
votes
Accepted
Setting different GDAL configuration folder when calling ogr2ogr with Python subprocess
To set the GDAL_CONFIG_FILE environment variable for only that process you can pass the env arg to subprocess.run().
This expects a dict containing the complete set of vars to be used, so you should ...
- 4,643
Top 50 recent answers are included
Related Tags
ogr2ogr × 1086gdal × 319
shapefile × 195
postgis × 181
geojson × 127
ogr × 110
qgis × 107
postgresql × 96
python × 75
coordinate-system × 63
kml × 52
sql × 51
openstreetmap × 50
file-geodatabase × 48
sqlite × 43
convert × 41
sql-server × 38
spatialite × 36
geopackage × 32
csv × 30
dxf × 28
gml × 22
osgeo4w × 21
wfs × 20
sql-server-spatial × 18