[gdal-dev] convert linestring to point data

Even Rouault even.rouault at mines-paris.org
Fri Feb 1 01:01:27 PST 2013


Selon Tyler Mitchell <tyler.mitchell at actian.com>:

> Just a brief follow up for posterity on the list...
>
> I've completed my first run of updates on this script and it's looking pretty
> good.  Others welcomed to give feedback :)
>
> It's been modularised now and also allows you to enter a field name to take
> the Z value from.
>
> So Murat, it does everything you need now, so grab a fresh copy!
>
> The only other improvement I can think of is to specify an output format and
> create a non-CSV output instead.

A few other ideas :
* add a header with the licencing
* deal with multipolygons (shapefiles can mix polygons and multipolygons in
polygon layers)
* test the geometry type on the actual feature geometry, and not the layer
geometry (for the above reason)
* be robust to features with null geometry
* you can use the ogr.wkbPoint, ogr.wkbLineString, etc. constant instead of
testing against the numeric values and returning a string (check_ftype() is
unnecessary)

Even


More information about the gdal-dev mailing list