[Geoserver-devel] [Geotools-gt2-users] "Transforming" WFS

Hi Jerry,

Glad to be of help. Comments inline.

Could you implement your system as a custom output format in geoserver

that would take the

features, do a bunch of transformations on their geometries, and then

give some new features

back to the client?

Since I may also want to transform the non-geometric aspects of the XML
schema, this might be a bit too restrictive...

Well actually it wouldn't be restricted to just geometries. You would
have 100% control of how the xml is generated. Basically an output
format ( in geotools / geoserver speak here ) gets a feature collection,
which is the collection of data matching a request. The output format
has full control over this.

Recall that (in implementation terms) the adaptor has client and server
components: the server is connected (via http) to the external client
and the client is connected (again, via http) to the external server.

The issue is then what geoserver\geotools functionality can best
implement the client and server components and how best to couple them
together.

So the more I think about it and your requirement to be a middle layer
between existing client and server the more it sounds like WPS.

One possible scheme might be as follows:

Presumably there a server API available (in Geoserver?) that pulls in
data from some datasource and marshalls the geometry into XML in
response to a feature request.

Yup, its the output format api described above.

A custom datasource could use something like
org.geotools.demo.example.WFSClient (which provides a simple example of
unmarshalling XML into geometry).

This (together with some polymorphic hooks for the transformation)
should suffice for the geometry, but the above scheme would also need
separate communication between the client and server components for the
non-geometric aspects of schema transformation.

What I'm hoping for is a broad explanation that identifies the
appropriate API level
for communication between the client and server sides in order to tie
these two things
together into a single component.

Ok, so just to make sure I understand the requirements. What you need is:

A special service which talks wfs. This service delegates to another
existing wfs to grab some data. The service then applies some
transformation to the data ( geometric and non-geometric attributes ).
The service then returns that result to the calling client.

Apologies if i am missing any key points.

So I think you are on the right track by looking at the WFS demo client
code. This is the first piece of the puzzle as it allows you to fetch
the data,

The next piece is for lack of a better term, your special transformation
engine, which I imagine will be some api that you come up with for
performing features. Ideally it sounds like you want to make the api
plugin based.

The last piece is where GeoServer comes in and allows you to bundle the
above components into a web service. You can define the adaptor as its
own service, which sit between the external client and server. The api
for defining new services in GeoServer is relatively new and available
only on the trunk development branch. Here are some preliminary docs, i
apologize, some parts are incomplete, but they are good enough to give
you the general idea of what defining a new custom service will look like.

http://docs.codehaus.org/display/GEOSDOC/3+A+Simple+PlugIn
http://docs.codehaus.org/display/GEOSDOC/2+Http

So if I have understood the scope of your problem, give these docs a
read and hit be back with any questions you might have.

-Justin

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org