Tagged Questions

The OGR Simple Features Library is a C++ open source library (and command line tools) providing access to vector file formats.

learn more… | top users | synonyms

5
votes
1answer
345 views

How to label raster cells in QGIS?

I try to show a small resolution raster file in the QGIS Print Manager tool. I would like to show a small label with each cell value (position - circa middle of each cell). How I can do it? Is there ...
7
votes
2answers
720 views

DXF attribute to z value

We have been given a DXF that contains a Elevation attribute but we would like to generate a 3D DXF. I know I can generate a 3D dxf from a shapefile using: ogr2ogr -f "DXF" out.dxf in.shp -zfield ...
3
votes
1answer
274 views

Polygon Shared Boundaries in GML

Last week I was told on a phone conference that GML supports shared boundaries in Polygon's. I have been unable to find any documenatation to substantiate the claim. Here is the situation: I have a ...
4
votes
4answers
542 views

Determine Projection

I was given a shapefile at work with the information that it is in Lambert Azimuth Equal Area (LAEA) projection (EPSG 9820). After some research on the web, I found out that EPSG 9820 is a generic ...
5
votes
1answer
354 views

Combined area of all features within features of another layer

I have a grid shapefile (basically, a half-degree grid of the world, where each cell has a unique id number), and a set of files with features. I want to record for each grid cell, all the areas ...
7
votes
1answer
1k 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 ...
2
votes
3answers
2k views

Read KML file with GDAL/OGR for Python

I have file : test.kml and I try to open it with GDAL/OGR (1.6) librairie in Python (2.5). But I don't succed can you help me ? This is my code : from osgeo import ogr adresse = 'test.kml' ...
21
votes
2answers
3k views

Python Efficiency — Need suggestions about how to use OGR and Shapely in more efficient way

I'm looking for some suggestions about how to make my python code more efficient. Normally efficiency doesn't matter for me but I am now working with a text file of US locations with over 1.5 million ...
6
votes
1answer
883 views

Spatial joins in OGR SQL

I have seen that OGR supports it's own form of SQL, I was wondering if it's possible to do spatial joins. Something like select all objects where one intersects the other. I did have a look around ...
13
votes
7answers
3k views

Free tool to simplify parcel shapefiles?

Is there any tool available which let's me run millions of parcel shapefiles and simplify them?
14
votes
5answers
7k views

What's the easiest way to install GDAL and OGR for Python?

I am developing some code in Python, and I want to use the GDAL/OGR python bindings. What is the minimum I need to install in order to use the GDAL and OGR python bindings? What is the easiest way to ...
1
vote
2answers
310 views

Is it possible to save PostGIS connection string in OGR add-in to QGIS?

In QGIS I've saved a couple of PostGIS connections for adding data. This works fine. I've been unable to save the connections in the OGR layer converter add-in though. Has anyone found a way to do ...
8
votes
6answers
886 views

How do I generate thumbnails images from lots of shapefiles?

A colleague and I recently released an Open Source project called Mapoteca which is a set of Python Scripts that integrates with a GDAL/FWTools installation allowing a full walk-through of directories ...
2
votes
1answer
813 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 ...
9
votes
3answers
3k 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
3k 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
410 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 ...
10
votes
3answers
2k 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, ...
3
votes
2answers
2k 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
210 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 ...
14
votes
4answers
7k 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 ...
14
votes
6answers
5k 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 ...
10
votes
5answers
3k 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 ...
1
vote
1answer
934 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
655 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
1k 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 ...
6
votes
4answers
2k views

Is it possible to 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 ...
1
vote
2answers
567 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
1k 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
3k 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
2k 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
673 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
3k 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: ...
8
votes
4answers
2k 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
259 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
2k 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
3k 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
2k 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 ...
5
votes
1answer
3k 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.
9
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?