Xiaoyu Guan wrote:
Dear All:
I would like to use GDAL/OGR library for converting GML files to Shp
files. I have look around on internet. there are a lot of people use
OGR2OGR convert them. I have already try use ogr2ogr , convert gml to
shp. unfornately, the result is not what I expected. for example. I
convert one ploygon file, there are few attributes lost. So I would like
to know how to write a python script to done the job.
Is possbile that somebody give me some hints? for example how many steps
to slove the problems? what is the data flow?
Xiaoyu,
It might be helpful if you provided a sample GML file you would like to
translate and explained the problem you encountered using ogr2ogr.
If you use the Python bindings for OGR to read the GML file it is
possible you will see similar problems to ogr2ogr since the data
access mechanism is the same. The OGR GML driver certainly has many
problems with sophisticated GML.
I think the following script should give an idea how to read data
from one OGR datasource, and write it to another. The script is
also intended to provide a hook function to apply transformations to
the coordinates though I don't think you will need this aspect.
http://svn.osgeo.org/gdal/trunk/gdal/swig/python/samples/vec_tr.py
Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, [email protected]
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial Programmer for Rent
_______________________________________________
gdal-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/gdal-dev