[gdal-dev] How to convert line string to point or polygon to line string (e.g. shapefile to gpx conversion)

Stefan Keller sfkeller at gmail.com
Thu Sep 10 05:07:44 EDT 2009

Dear all,

Given for example a shapefile containing polygons (or polylines, even
multiple...) and GPX as the target format: How can one convert this to
line strings (or points)?

Discussion: I understand that there are two possibilities, either the
input reader is instructed (and capable) to convert polygons (or
polylines) to OGR type wkbLineString or the output converter takes OGR
type wkbPolygon and is instructed (and capable) to write line strings
(holds correspondingly to converting polyline to points).

Any solutions?


P.S. Background: I'm running an online converter (geoconverter.hsr.ch)
which simply uses OGR and I often get service requests like this from
OGR freshmans.

More information about the gdal-dev mailing list