The OGR Simple Features Library is a C++ open source library (and command line tools) providing access to vector file formats.
2
votes
1answer
499 views
gdal_grid problem reading vrt file
I am trying to parse csv file and visualize it as geotiff using gdal_grid but I keep getting this error:
C:\work\testgdal1>gdal_grid -ot Float32 -l test test.vrt dona.tif
ERROR 1: Failed to ...
6
votes
3answers
2k views
Get all vertices of a polygon using OGR and Python
I'm having a little trouble with the Python OGR API. What I am trying to do is get all the coordinates of each vertex of the outer ring of a polygon.
This is what I have so far:
import osgeo.ogr
...
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 ...
2
votes
0answers
361 views
OGR VRT MSSQL example
I'm trying to import vector data into SAGA GIS from a SQLExpress 2008 server.
Firstly is this possible?
I would have thought using an OGR VRT layer would have been the way to do it, I've attached a ...
9
votes
3answers
933 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, ...
1
vote
2answers
881 views
ogr2ogr srs options: where is the well known definition determined?
In the ogr2ogr documentation it says that when using -a_srs srs_def:
Srs_def can be a full WKT definition (hard to escape properly), or a well known definition (ie. EPSG:4326) or a file with a WKT ...
2
votes
2answers
173 views
Project geometry features upside down
I have shapefiles containing polygons and lines that are used in a mapfile for projecting them through Mapserver. Is there a way in changing the projection of the layers by 180 degrees(i.e. upside ...
12
votes
4answers
4k views
How to add an attribute field to an existing Shapefile via Python
I have a Python script that adds an attribute field to a Shapefile if doesn't exist. This is easy to do with ArcGIS (graphically or via Python), but I'm looking for something that doesn't depend on ...
12
votes
5answers
3k views
Generate points that lie inside polygon
I have polygon feature and want to be able to generate points inside it. I need this for one classification task.
Generating random points until one is inside the polygon wouldn't work because it's ...
8
votes
4answers
2k views
installing GEOS, PROJ, GDAL/OGR into a python virtualenv on Mac OS X
I am trying to setup an isolated python virtualenv to work on GIS projects on my Mac OS X. Sounds like I will need to install the GEOS, PROJ, GDAL/OGR from the kyngchaos site here ...
0
votes
1answer
745 views
Reprojecting from MGRm to WGS84 using open-source tools
I would like to work with some of the Michigan state data (for example, this shapefile of cities ), but it is not in a common projection. However, when I try to reproject the file using ogr2ogr and ...
1
vote
1answer
492 views
GRASS v.out.dxf 3D into AutoCAD
So continuing with my last question (Create 3D dxf with OGR) I have decided to give the GRASS option a go.
I have imported my polylines into GRASS using v.in.ogr and converted them to 3D using ...
5
votes
2answers
946 views
Call FWTools (ogr2ogr) from ArcGIS python script
In ArcGIS, I want to use a Python script (and a standard ArcGIS script tool UI) to call functionality from FWTools.
How would I make the call to FWTools? I tried using ...
5
votes
3answers
1k views
Create 3D dxf with OGR
Does anyone know if it's possible to create a 3D dxf with OGR. I would like to assign our contour lines a z value and export them to dxf for some cad work.
PS I know FME can do this, however I would ...
0
votes
2answers
470 views
Why is every SELECT via a geometry function null?
I'm using Spatialite (2.3.1, binary from the website) on Windows XP via Java ("Xerial Driver"). SQLite loads fine, also Spatialite seems to be loading successfully. I can even do SELECT-statements. ...
4
votes
2answers
771 views
create temporary point geometry feature from coordinates in OGR with Python
I have two shapefiles containing two types of geometry features: one contains polygons and the other linestrings.
Because I'd like to use the Within method to check whether the end(or start) of a ...
10
votes
2answers
3k views
Point (of a linestring) within Polygon using ogr and Python
I'm currently working on a project in which I need to build a topological network out of the geometry features I find in shapefiles.
So far using Ben Reilly's open source project I've managed to ...
7
votes
3answers
2k views
How To Convert A Set of ARC/Info ASCII .e00, .e01, .e02, etc Files Into .shp Files
I have a set files that I downloaded with extensions (.e00, .e01, .e02, etc). I have read that these are files used by ARC Info mainly, but I do not have ARC and nor am I really that interested in ...
8
votes
4answers
1k views
Best way to find the polygons crossed by a line
I'm trying to find all the polygons crossed by a single line (a GPS track).
I'm using the OGR library (from python) for computing this, but it's currently a bit 'brute-force' (and slow). For every ...
4
votes
1answer
544 views
esri pgdb in qgis
Using osgeo4w 1.5, when I go to add vector layer and select file type,
navigate to my esri pgdb. I get a not a valid or recognized data source.
If I use the database type I get a page that defaults ...
7
votes
2answers
2k views
How to convert GML Surface to SHP Using OGR?
I have a very large .gml file with multiple layers in it. I would like to export one of these layers to .shp. It is a polygon layer (of lakes). However, I am getting the error:
ERROR 1: ...
7
votes
4answers
1k views
how can i convert a shapefile to lat and lon boundaries?
i have a shapefile of country subdivisions and i would like to extract an array of bounding lat and lon for each division.. is it possible to do?
3
votes
2answers
204 views
Segmentation Fault (segfault) when using OGR CreateField() in Python
Receiving a segfault when running this very short script in Ubuntu.
from osgeo import ogr, osr
shpfile = 'Census_County_TIGER00_IN.shp'
def cust_field(field):
'''cust_field(shpfile, field) ...
10
votes
2answers
1k views
How to add custom Feature attributes to ESRI Shapefile with Python?
I am seeking a way to take an existing ESRI Shapefile that has a Feature set of 200 countries. Each country Feature has an attribute of "NAME." My objective is to create a Python script that adds an ...
7
votes
2answers
2k views
Deploying Application With C# GDAL/OGR Bindings
I developed a relatively simple web app that uses the C# OGR bindings to do a couple of simple geometric functions; buffer, clip...etc. I developed this application on my local machine, which has ...
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 ...
4
votes
1answer
1k views
How to resample a batch of rasters using OGR/GDAL?
I'm looking for a function similar to GRASS r.resample. I have a folder full of TIF files and want to reduce their resolution ("scale them down") to reduce file size.
6
votes
5answers
1k views
How to convert line simple features to topological network?
using Gdal/ OGR is there a way to convert a shp, kml, or PostGIS line layer into a network of nodes and segments so it can be used in packages such as networkx?
