[Shapelib] Shapefile decimation

Ken S. Elvehjem elvehjem at runestone.net
Mon Nov 13 05:10:43 PST 2006


Mike,

Had to do this one, once.  

The algorithm I used started w/ the first 3 points, determined how "close" they were to being in a straight line (area of triangle) , and if they were too nearly in a line, kicked out the center point -- Then I tested points # 1,2, & 4 and so on.  Crude, perhaps, but effective...

It worked well for the data I was "thinning out," namely GPS points taken at 5 hits / second on a vehicle moving 5-15 miles/hr.

Depending on the extents involved,  you might have to put a limit on how long a segment could be - If your track is more or less a straight line anyway, kick out more points.  If it wanders around on a roughly square piece of water, then being able to view the effects of different removal methods would be handy.  If you are working inside of a harbor or port, then  curvature of the earth, great circle nav, and other complications probably don't apply, but maybe out on the open ocean, they will probably have some effect.

Ken
Ken S. Elvehjem
ELVEHJEM TECHNICAL SUPPORT

  ----- Original Message ----- 
  From: Mike.Sexton at ga.gov.au 
  To: shapelib at lists.maptools.org 
  Sent: Sunday, November 12, 2006 8:07 PM
  Subject: [Shapelib] Shapefile decimation


  Hi,



  I have another query.



  Last time I asked about making shapefiles from ASCII X,Y files. I followed up on the suggestion of modifying shpadd.c to read from an input file and a friend modified the code and in virtually no time produced a very good result



  In fact too good.



  The files are very large. I would like to decimate the shapefiles. I have scanned the web looking for a program that might achieve this. I found the program fshape and to my utter amazement got it too work. I need to play with the parameters a bit (my first attempt was a bit severe). But since the various shapes in the shapefiles are ships tracks, it would probably be just as valid to accept only every 10th point (or even less). I could go back to the original datafiles and decimate them (although they were in a myriad of formats and I kept altering my script to pull out the bits I need). This is not an attractive option when the 2000 odd shapefiles are in a standard format already.



  I was wondering if a shapefile decimator existed?



  Otherwise I might have to go back to my friend



  Thanks





  Mike Sexton



------------------------------------------------------------------------------


  _______________________________________________
  Shapelib mailing list
  Shapelib at lists.maptools.org
  http://lists.maptools.org/mailman/listinfo/shapelib
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/shapelib/attachments/20061113/36127cf4/attachment.html>


More information about the Shapelib mailing list