Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options questions only not deleted user 7785

ogr2ogr is an open source command line utility popular for converting to and from various vector spatial data formats.

1 vote
0 answers
2k views

Import .gfs file into PostGIS?

I have Googled but can't find any examples of doing this with ogr2ogr. Do I need to convert it into some intermediate format first? …
Richard's user avatar
  • 3,329
3 votes
2 answers
378 views

ogr2ogr giving "ERROR 1: Failed connect to 192.168.4.18:8181; Operation timed out" error?

This is my command, which was working OK yesterday: ogr2ogr -f "GeoJSON" ../geojson/myfile.geojson .. … /data/gml/myfile.gml -s_srs EPSG:27700 -t_srs EPSG:4326 The output is this: ERROR 1: Failed connect to 192.168.4.18:8181; Operation timed out I'm baffled, why would ogr2ogr need to connect anywhere …
Richard's user avatar
  • 3,329
5 votes
1 answer
1k views

ogr2ogr: Can I add a field when I import to PostGIS?

I can import individual files perfectly as follows: ogr2ogr -f PostgreSQL PG:"host=x user=x dbname=x password=x" myfile.geojson -nln my_table But as I import them, I want to add an extra column to these … Is this possible using ogr2ogr? …
Richard's user avatar
  • 3,329
5 votes
2 answers
3k views

ogr2ogr: don't import properties on each feature?

I have a 2MB shapefile that when converted to GeoJSON becomes 10MB: $ ogr2ogr -f "GeoJSON" -t_srs EPSG:900913 landfill.geojson Authorised_Landfill_Sites_010k.shp I can reduce the size of the GeoJSON … REGION": "North East", "AREA": "Yorkshire", "DATE_ISSUE": "2007\/06\/21", "LIC_EPR": "EA\\EPR\\BK0507IB" }, "geometry": { "type": "Polygon", "co ordinates": [ [ [ -131830.27, 7161699.84 ] Can I use ogr2ogr
Richard's user avatar
  • 3,329
10 votes
4 answers
6k views

ogr2ogr sql: what is the name of the geometry field?

metre",1, AUTHORITY["EPSG","9001"]], AXIS["Easting",EAST], AXIS["Northing",NORTH], AUTHORITY["EPSG","27700"]] gml_id: String (0.0) NOT NULL LABEL: Integer (0.0) I want to run an ogr2ogr … This is what I'm trying: ogr2ogr -f GeoJSON output.geojson input.gml -sql "select gml_id, geom from PREDEFINED" But I get ERROR 1: Unrecognized field name geom.. …
Richard's user avatar
  • 3,329
5 votes
1 answer
446 views

Reprojecting a CSV file using ogr2ogr?

landfill):2010 ctroid_x (String) = 567600 ctroid_y (String) = 314500 region (String) = Anglian area (String) = Central date_issue (String) = 21/10/10 POINT (567600 314500) But when I run ogr2ogr … : $ ogr2ogr -s_srs EPSG:27700 -t_srs EPSG:4326 -f CSV -lco "GEOMETRY=AS_WKT" . …
Richard's user avatar
  • 3,329
5 votes
2 answers
5k views

How to export thousands of features from PostGIS to a single GeoJSON file?

I know how to export one feature from a PostGIS database using ogr2ogr: $ogr2ogr -f GeoJSON out.json "PG:host=localhost dbname=xxx user=xxx password=xxx" -sql 'select id, county, wkb_geometry from cities …
Richard's user avatar
  • 3,329
3 votes
1 answer
706 views

ogrinfo: Get a sample row from a GeoJSON file?

I know how to examine the properties of a GeoJSON file: ogrinfo my.geojson OGRGeoJSON -so But is there a way that I can retrieve a single feature's actual properties, to see what they look like? I …
Richard's user avatar
  • 3,329
8 votes
3 answers
3k views

ogr2ogr import fails with "ERROR 1: GeoJSON object too complex"

I'm trying to import a large (8.8GB) GeoJSON file to a Postgres 9.6 database with the following command: ogr2ogr -f "PostgreSQL" -nln final_diffs PG:"host=localhost dbname=inspire user=me" diffs.geojson …
Richard's user avatar
  • 3,329
6 votes
1 answer
1k views

Transforming a shapefile from EPSG:3338 to EPSG:4326?

This happens both whether I export it in QGIS, or use ogr2ogr: ogr2ogr -f GeoJSON -s_srs EPSG:3338 -t_srs EPSG:4326 . …
Richard's user avatar
  • 3,329