I am trying to create a DXF from a Polygon Shapefile using ogr2ogr:
ogr2ogr -f DXF parcels.dxf parcels.shp
The problem is that the polygons are written as hatch elements.
How do I specify that ogr2ogr should create LWPOLYLINE elements (Or any…
Is it possible to load a shapefile to a PostGIS database by replacing the content of the table with the new content of the shapefile WITHOUT DROPPING the table?
I want to do this using ogr2ogr.
In the past I have used shp2pgsql, which gives you the…
We have started using ogr2ogr to upload MapInfo tables into Microsoft SQL server in my workplace. Some of the tables are massive (>1,20,000 records) and there is no way of knowing how far the script has progressed without a status bar.
I was…
Im trying to export a table from MSSQL to geopackage using ogr2ogr:
This is the exact command I try in windows terminal (but with real serv,db,user,pass ofc):
C:\OSGeo4W64\bin\ogr2ogr.exe -f "GPKG" C:/GIS/data/testdata/test123.gpkg…
I wonder what's the difference between the ogr2ogr parameters -append and -update.
It seems that they both are used to prevent ogr2ogr from creating a new layer:
-append: Append to existing layer instead of creating a new one
-update: Open existing…
I have a CSV file with the following structure:
id,Geometry
0,MULTIPOLYGON(((343362.10597 7395133.999035, 343362.608646 7395137.592628, 343366.027235 7395138.714539, 343389.482792 7395141.302312, 343390.91157 7395141.3619, 343408.443301…
I use ogr2ogr to import an .sqlite file into my PostgreSQL database. The new database table I get has a column of type "character varying". However I want it be of type integer as all the values in the particular column are integer numbers with the…
Can ogr2ogr be used to append multiple DBF files? It works with SHP files, but I can't see how to do it with DBF files on their own. It ought to be possible, considering DBF is a subset of SHP.
I downloaded one of files from https://use-land-property-data.service.gov.uk/datasets/inspire/download and I am trying to convert it to some friendlier format with ogr2ogr
I tried ogr2ogr -f "ESRI Shapefile" output.shp input.gml but ogr2ogr just…
I'm trying to move from downloading geodata manually and then working with it using ogr2ogr on the local file to just reading the data in from the url directly in order to have the actual source in the code and save myself some work.
For example…
I have downloaded a shape file of Chicago building footprints from here. Unzipped it and ran
ogr2ogr -f csv -dialect sqlite -sql "select AsGeoJSON(geometry) AS geom, * from 'geo_export_98941210-c995-4502-8ebb-93a09f29d615'"…
I'm querying this map service using ogr2ogr to create a local copy of it's features:
http://geoportal.menlhk.go.id/arcgis/rest/services/KLHK/Deforestasi_2006_2009/MapServer/0
Here's my ogr2ogr code, using where clause objectid > 0 to select…
What's the difference between the two flags -a_srs and -s_srs.
From what I read they both define the EPSG the Input-File has. When using -s_srs ogr2ogr says that -t_srs must be used as well.
But when setting -a_srs instead of -s_srs it runs without…
This weekend I started using ogr2ogr and discovered that it's a great tool for converting from one spatial reference system to another. I used it to convert a shapefile to GeoJSON, from WGS84 to a NAD83 stateplane, and wanted decimals truncated, but…