[Gdal-dev] downsampling shapefiles ?

Daniel Morissette dmorissette at dmsolutions.ca
Sun Sep 11 23:01:13 EDT 2005


Frank Warmerdam wrote:
> 
> Nevertheless, I think it would be better to build some broadly useful
> functions (like generlization) directly into OGR. 
> 

FWIW, I quickly hacked a LineString downsampling function into a local 
copy of ogr2ogr a few days ago. I have attached a patch file that can be 
applied to a recent copy of ogr2ogr.cpp if anyone wants to try it. Add 
"-gen_tol <value>" to the OGR2OGR command to enable downsampling to the 
specified tolerance (specified in the same units as the coordinates of 
your data).

This code is still untested and is not ready to officially integrate in 
OGR because it supports only LineStrings (other geometry types are left 
untouched) and the function should probably be moved to the 
OGRGeometryFactory class. Use at your own risk.

Daniel
-- 
------------------------------------------------------------
  Daniel Morissette               dmorissette at dmsolutions.ca
  DM Solutions Group              http://www.dmsolutions.ca/
------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ogr2ogr_generalize.patch
Type: text/x-patch
Size: 5347 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/gdal-dev/attachments/20050911/ec929a64/ogr2ogr_generalize.bin


More information about the Gdal-dev mailing list