Day: March 4, 2007

  • PostGIS: From Multilinestring to Linestring

    Continuing on with my PostGIS tinkering, I’ve been further exploring getting data in and out of PostGIS. After recompiling GEOS to get the C API working so that I could start working with the new features in PostGIS 1.2.1.

    One of the problems I ran in to is that gpx2shp really likes to import data as a Multilinestring, while in the simplest case of a single-track GPX file, it should really be a Linestring. After searching a bit, I came across a mention of linemerge which can turn a Multilinestring such as MULTILINESTRING((-95.235071 38.971896,-95.235076 38.971906,-95.235015 38.971848)) in to a LINESTRING(-95.235071 38.971896,-95.235076 38.971906,-95.235015 38.971848), which seems like a saner way to work with single tracks.