Tagged Questions
0
votes
0answers
20 views
NYC Building Perimeter Shapefile after 2011
I've been using the following NYC building perimeter shapefile from the DOTT for some work. This file however dates back to 2010. Is there a newer one available, and if so where?
I have found this ...
2
votes
1answer
88 views
Need help assigning values to field using OGR in python
I've got a similar question to this one How to programatically populate a shapefile field with polygon areas in OGR?, but the solution doesn't seem to be working for me. I am trying to import a ...
4
votes
1answer
71 views
How to use -lco options in gdal_contour?
I'm trying to create contours from geotiff raster with gdal_contour. My output format is Postgresql and I would like to ovewrite the existing table.
When I do:
gdal_contour -a 1 -f PostgreSQL -i 50 ...
2
votes
1answer
170 views
How to bulk delete shapefile columns?
I have shape-file with next attribute table:
- name of features, unique number for each feature of layer
I must split shape-file by NAME field, but in result in attribute tables of layers should be ...
5
votes
1answer
160 views
Geometry errors when importing data from ESRI file geodatabase to PostGIS
When I run the following command to import by data from an ESRI fgdb to postgis...
ogr2ogr -f "PostgreSQL" -a_srs "EPSG:28355" -t_srs "EPSG:3857" PG:"dbname=tp_test user=postgres port=54321 ...
4
votes
2answers
229 views
How to programmatically create exports from PostGIS database into different file formats (e.g. shapefile, dxf, dgn,…)?
Is there a kind of wrapper/library written in python which would enable me to programatically create exports from postgis database into different file formats (most common being, shapefile, dxf, ...
3
votes
2answers
224 views
Why does Ogr2Ogr Postgres import fail?
I have a lot of S57 files that need to be imported to PostgresDB. The process takes over 2 hours. In order to improve performance, I have tried using PG_USE_COPY to use copy instead of DB inserts. I ...
2
votes
2answers
315 views
Export from posgis to spatialite?
My postgis database contains osm data from my country. For transportation reasons i want to export a spatial view i created from those data to an spatialite database.
Is there any way to directly ...
7
votes
2answers
268 views
How to catch PostgreSQL/PostGIS errors in GDAL/OGR Python bindings?
Is it possible to catch PostgreSQL output error messages in OGR after a query has failed?
For example
conn.ExecuteSQL('SELECT * FROM non_existing_table;')
In Postgres this returns an error ...
3
votes
1answer
710 views
Convert KML to shapefile without losing attribute data
So I want to convert KML files to SHP shapefiles to load it onto PostGIS. Currently I'm using ogr2ogr to do the conversion for me, but it wipes out all the attribute data. How do i preserve this ...
5
votes
2answers
904 views
Is it possible to get the EPSG value from an OSR SpatialReference class using the OGR Python API?
When reading a layer from a OGR PostGIS connection I can get the SpatialReference of the layer, but is it possible to get the EPSG value? Is there any documentation on this?
For example:
lyr = ...
2
votes
1answer
471 views
Exporting PostgreSQL table to FileGDB: wkbUnknown layer geometry type
I'm attempting to export a PostGIS (1.5.3) database table as a File geodatabase using the new FileGDB OGR / GDAL 1.9.0 driver:
$ ogr2ogr -overwrite -sql "SELECT * from db_pts LIMIT 1" \
-f ...
3
votes
1answer
586 views
How to assign OGR geometry a spatial reference when writing to a new layer using the Python API?
I'm using the Python OGR API to add new features to a PostGIS layer. However, despite setting the geometry spatial reference, when the geometry is written out the spatial reference is missing. This is ...
5
votes
2answers
415 views
Accessing non-spatial PostgreSQL tables using OGR Python bindings
When connecting to PostgreSQL/PostGIS using the OGR Python bindings is it possible to get non-spatial table names (i.e. OGR layers) from the connection?
Currently, doing:
conn = ogr.Open("PG: ...
7
votes
1answer
865 views
Help with PostGIS polygon geometry - non-closed rings
I've picked up a copy of the super-wicked book 'Python Geospatial Development' by Erik Westra (Amazon link), and I'm working through it. Currently, it's teaching me to load GSHHS coastline data from a ...
1
vote
4answers
2k views
ogr2ogr, convert from shp to postgis error
I am trying to import a shapefile into PostGIS using the ogr2ogr tools that are built into the FWTools package. In my import process I am receiving an error that I don't know how to deal with.
ERROR ...
9
votes
3answers
937 views
getting dxf files out of PostgreSQL
I've successfully loaded a bunch of shapefiles into a PostGIS database. I would like to be able to retrieve specific geometry and layers as dxf files based on SQL queries.
I'm using PostGIS, GDAL, ...
5
votes
2answers
1k views
Geodatabase to PostGIS character encoding
Similar to another question I posted previously, I'm trying to import datasets from Esri geodatabases into a PostGIS database directly, and inside the data there are greek letters and symbols that are ...

