[gdal-dev] [python] CopyDataSource question

Frank Broniewski brfr at metrico.lu
Tue Dec 20 04:53:44 EST 2011


Hi,

I have (again) a question concerning the Driver.CopyDataSource() method 
using OGR Python bindings

I've written some code that copies a datasource to another format, using 
a target driver and its CopyDataSource() method. This works fine for 
GDAL version 1.7.3, but fails under 1.8.0. Failing means that the 
CopyDataSource call is made but never finishes. It just sits there and 
does nothing. This is however related to *my code*, and *not* an OGR 
error. Doing the task with OGR classes directly works. But I wonder why 
my script runs fine on one system but not on the other.

I have some sample test data with which I test my code. The sample is a 
point shapefile and I copy it to GeoJSON, GML and KML formats. The 
GeoJSON still works, but the GML test fails, and KML also.

So my question (at last ;-)): What could make the CopyDataSource fail 
with GML and KML, but succeed with GeoJSON? And make it completely 
succeed under GDAL 1.7.3?

Looking at ogr2ogr.py, CopyDataSource is never used there. Am I abusing 
CopyDataSource? Is it the right tool to copy a datasource to a new format?

I know my question is a bit like reading in a crystal ball, but I hope 
my description rings a bell somewhere. Since CopyDataSource just sits 
there and does nothing and needs to be terminated I lack something I can 
investigate in.

Many thanks

Frank

PS
Source code can be seen here:
https://bitbucket.org/frankbroniewski/geoactions/

-- 
Frank BRONIEWSKI

METRICO s.à r.l.
géomètres
technologies d'information géographique
rue des Romains 36
L-5433 NIEDERDONVEN

tél.: +352 26 74 94 - 28
fax.: +352 26 74 94 99
http://www.metrico.lu


More information about the gdal-dev mailing list