ogr2ogr is used to convert simple features data between file formats performing various operations during the process such as spatial or attribute selections, reducing the set of attributes, setting the output coordinate system or even reprojecting the features during translation.
Questions tagged [ogr2ogr]
97 questions
13
votes
4 answers
GDAL, ogr2ogr "Cannot find proj.db" Error
I've tried to extract certain country from the world shp file from natural earth.
I am currently using windows 10, so I installed python 3.7, gdal to use the ogr2ogr.
I typed the below code in the command to extract the south korea
ogr2ogr -f…

Yang JongHyun
- 133
- 1
- 1
- 6
7
votes
0 answers
How to safely abort a piped stream in NodeJS?
I'm using Requests to pipe an HTTP Stream to a local geospatial file-processing utility, ogr2ogr:
httpStream.on('response', function(response) {
var ogr = ogr2ogr(response)
.skipfailures()
…

Steve Bennett
- 114,604
- 39
- 168
- 219
6
votes
1 answer
ogr2ogr does not create tables
im trying to import some shapes to SQL using ogr2ogr command following this guide https://alastaira.wordpress.com/ogr2ogr-patterns-for-sql-server/
Im using this command:
ogr2ogr -overwrite -f MSSQLSpatial [connection string] [shapefile]
-nln…

LaPregunta
- 191
- 1
- 2
- 6
5
votes
3 answers
How to project the shapefile with GDAL ogr2ogr
The GDAL ogr2ogr project the shape file with EPSG:28991 and create .prj file near Amersfoort. But the actual place of shp file should be in amsterdam.
How to reproject the shape file to locate it on amsterdam with the help of xmin ymin xmax,…

Amar Shilpakar - ITH
- 51
- 1
- 3
4
votes
1 answer
GDAL/ogr2ogr/ogrinfo produces an invalid pointer error each time I run it
After installing ogr2ogr following the steps described here
https://mothergeo-py.readthedocs.io/en/latest/development/how-to/gdal-ubuntu-pkg.html
When I run either ogr2ogr or ogrinfo, I get the following error message
free(): invalid pointer
AFTER…

pvk
- 41
- 4
4
votes
2 answers
flatten/dissolve/merge entire shapefile
I've been using ogr2ogr to do most of what I need with shapefiles (including dissolving them). However, I find that for big ones, it takes a REALLY long time.
Here's an example of what I'm doing:
ogr2ogr new.shp old.shp -dialect sqlite -sql "SELECT…

stewart715
- 5,557
- 11
- 47
- 80
3
votes
1 answer
Is there a way to change the projection in a topojson file?
I am trying to create a topojson file projected using geoAlbersUsa, originating from the US Census's ZCTA (Zip Codes, essentially) shapefile. I was able to successfully get through the examples in the excellent…

CindyHoskey
- 67
- 1
- 3
3
votes
2 answers
Convert Tables in Postgresql to Shapefile
So far I have loaded all the parcel tables (with geometry information) in Alaska to PostgreSQL. The tables are originally stored in dump format. Now, I want to convert each table in Postgres to shapefile through cmd interface using ogr2ogr.
My code…

user7590842
- 41
- 1
- 3
3
votes
1 answer
OGR2OGR with MS SQL on Ubuntu 16.04
I need to access a Microsoft SQL Server with OGR2OGR from an Ubuntu Server 16.04. It is working on Microsoft, so the basic setup is fine.
My problem is that when I run my OGR2OGR command (after installing GDAL with sudo apt-get install…

gagabu
- 41
- 5
3
votes
1 answer
Convert svg to geojson fails with ogr2ogr
I've downloaded an .svg map of Finland from http://www.amcharts.com/svg-maps/?map=finland
I want to convert it to topojson to use it with d3.js. I first start with svg to geojson conversion, but it fails.
I tried:
ogr2ogr -f "GeoJSON"…

Dmitry Smirnov
- 462
- 8
- 22
2
votes
0 answers
Mbtiles generation with tippecanoe on a mixed geojson feature file
I have a bunch of geojson files that I want to use to create a .mbtiles file, these geojson files were made by using ogr2ogr on a .osm.pbf file.
Though these files seemed to have mixed features within them, e.g. the linestring.geojson file has…

MacaScull
- 161
- 1
- 10
2
votes
1 answer
Batch convert multiple .GML files to postgis sql tables using ogr2ogr
I have a folder with 150 .gml files I need to upload to my postgis/postgres database. After the first gml is uploaded, the rest will be appended to it to form a single table. However I don't know how to make ogr2ogr iterate through each file...…

Theo F
- 1,197
- 1
- 11
- 18
2
votes
2 answers
convert a shapefile to kml using Gdal library in C#
Hi I want to convert a shapefile (shp) to kml using Gdal library in C#.
I write a code but the output is not in kml format.
Here is my code:
using OSGeo.OGR;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using…

A Mashhouri
- 21
- 1
- 4
2
votes
2 answers
Add timestamp fields to ogr2ogr import into Postgis
I managed to create a model/schema and insert geo-Points into Postgis using sequelize. Since I have a lot of points (>100K) I am longing back to the old way I used to import, using ogr2ogr (gdal), which was much faster (almost instant instead of >20…

musicformellons
- 12,283
- 4
- 51
- 86
2
votes
1 answer
ogr2ogr from MIF/MID to GeoJSON
I'm trying to convert a .mif file to GeoJSON. I've got .mif, .mid and .dbf. But when I convert it, the properties included in .dbf are not rendered in the GeoJson file. The command I use is : ogr2ogr -f GeoJSON file.json file.mif.
Is there something…

Camsae
- 21
- 3