[Gdal-dev] downsampling shapefiles ?

Frank Warmerdam fwarmerdam at gmail.com
Sat Sep 10 12:28:00 EDT 2005


On 9/10/05, Schuyler Erle <schuyler at nocat.net> wrote:
> I've been thinking about this myself -- I implemented Douglas-Peucker
> simplification in OGR + Python, and it was pretty slow.
> 
> I note that ogr2ogr could act as a command-line "filter" for vector
> layers. Frank, how do you feel about the idea of having a plugin
> architecture for ogr2ogr, so that a user could (say) specify a -plugin
> option on the command line that dynamically loads an .so file at run
> time. The plugin library would have hooks to parse command-line
> options, and to take an OGR geometry from the input layer and have the
> opportunity to return a different OGR geometry to be written to the
> output layer? Line simplification is one possible use for this; vector
> warping is another (which may not be that common of an operation, but
> it is one I've had to contend with in the not-too-distant past)... I'm
> sure we can collectively think of others.

Schuyler,

I don't think I would want to implement a plugin architecture for
ogr2ogr itself.  It is just a (not very pretty) utility.  What might have
better leverage is doing something similar for the OGR VRT format.
So an OGR VRT datasource could include a pointer to an external
plugin shared library that could apply various kinds of processing
to the features going through the VRT.  

You could do this now by implementing a new format driver as
a plugin, but then you are stuck implementing alot of extra driver
logic.  A VRT plugin might be much simplified.  Just a function
that receives OGRFeature's and can morph the feature or geometry
as it wishes, possible removing or returning multiple features. 

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

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent




More information about the Gdal-dev mailing list