[postgis-users] How to deal with linestring that is not simple (OGC compliant)

pcreso at pcreso.com pcreso at pcreso.com
Fri Aug 14 08:02:11 PDT 2009

Hi Pavla,

I have used a PostGIS database to store decades worth of GPS position data for our research vessels. This has been running for several years now. 

The points are retained to enable each to have a timestamp which allows joins to various instrument readings (in a table with over 200,000,000 readings) to provide positions for each reading.

We also generate a daily_track, for each vessel, which is mostly used for web mapping applications providing either info on surveys or access to the instrument readings.

A similar dataset, for acoustic surveys stores GPS positions for every transect, with a point for every ping, and a linestring derived from the points. In this case we use ST_simplify() to remove unnecessary vertices from the transect linestrings, as the transects are often straight lines.

We use Postgres partitions & clustered indexes to improve query performance.

We have had no issues with PostGIS storing these data, or with analyses or mapping applications using them.

This doesn't guarantee you won't have problems, but for what it's worth, my experience with PostGIS & GPS data as tracklines has been totally positive. 


  Brent Wood

--- On Fri, 8/14/09, Pavla Novakova <pavla_novakova_work at yahoo.com> wrote:

> From: Pavla Novakova <pavla_novakova_work at yahoo.com>
> Subject: [postgis-users] How to deal with linestring that is not simple (OGC compliant)
> To: postgis-users at postgis.refractions.net
> Date: Friday, August 14, 2009, 8:46 PM
> Hi,
> I'm very new to both GIS and PostGIS spatial database.
> I've started read
> PostGIS manual (1.4) and on chapter 4.2.5 found: 
> "As such, many PostGIS
> methods require, or more accurately, assume that geometries
> that are
> operated on are both simple and valid." 
> This has broken my idea how to represent GPS track in
> PostGIS database: I
> thought about to save GPS track as linestring created from
> trackpoints, but
> this may generally lead to non-simple linestring.  My
> next thought was to
> split the non-simple linestring to multiple simple
> linestrings and this is where
> I need your help. Is PostGIS capable to do it for me? If
> not, what tool
> (best using java) can I use to split complex linestring to
> OGC compliant
> multiple simple linestrings please?
> Thank you very much for any help. 
> Pavla
>  Novakova
> -----Inline Attachment Follows-----
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users

More information about the postgis-users mailing list