On Oct 20, 2009, at 12:06 AM, CWHelm wrote:


This conversation reminds of me of what we're doing in our
applications at NREL. We're making use of a custom hybrid application
consisting of mapserver, tilecache, and featureserver to render our
map tiles and serve vector features. We've developed some pretty
complex use cases where we need to retrieve the result of a bbox query
in difference formats as well doing some geoprocessing (simplification
mostly, but also complex clustering).

Using featureserver as our "vector layer framework" has been great.
Each of our layers has its own config file and we can develop really
complex service chains that use whatever python classes that we want.

For example take a point layer: pointsA

In our FS config we have a datasource defined as:

[pointsA]
type=OGR
dsn=/path/to/the/file/pointsA.shp
layer=pointsA

this gives us the ability to get at the points in whatever format we
want and perform spatial queries. FeatureServer is great (and
beautifully restful).

So let's say we want to be able to access the buffer of each point.
We'd define a process and the a new layer in which each feature
requested is first passed through that process.

[process_buffer]
module=Buffer
class=Buffer
buffer_default=0.1
buffer_locked=no

and then we have a new layer:

[pointsA_buffers]
type=OGR
dsn=/path/to/the/file/pointsA.shp
layer=pointsA
processes=buffer

So now when we access the "pointsA_buffers" layer the features are the
same as "pointsA" but are buffered by whatever distance we've passed
in via the URL. The utility of this is huge! You can write any number
of "processes" and simply add them into your featureserver config. You
can also chain several together, the possibilities are endless and
wonderful.

We're starting to employ this method using shapely and OGR to do all
of the geoprocessing.

Chris

Chris,

The configuration you're doing reminds me of how one configures WSGI pipelines with Paste Deploy.

  http://pythonpaste.org/deploy/#composite-applications

The Pypes introduction was interesting. I can see how the author arrives at wanting a push style system, but I think it's still possible and productive to do it with pull (like you are doing). Google's MapReduce, for example, uses pull -- the reducer function reads from an iterator over data that is either huge or lazily computed.

--
Sean

Reply via email to