From: Andrea A. <and...@ge...> - 2012-06-21 06:51:53
|
On Wed, Jun 20, 2012 at 2:36 AM, Michael Bedward <mic...@gm...>wrote: > Hi Sergey, > > I don't know of an existing solution but it sounds like something that > could be done by writing a process class and using it in a rendering > transformation: > > http://docs.codehaus.org/display/GEOTOOLS/Rendering+transformations > > I'm copying this to Andrea who is the guru in this area. > Yep, a rendering transformation would do the job, thought it's not really necessary if you are in control of the data sources. What I mean is, one could ask the data source to do the sorting of the points via Query.setSortBy, so that they are already in the right order, and then write a wrapping feature collection whose feature iterator builds on the fly the lines from the points. On trunk I've added some time ago a base class that helps in setting up this kind of on the fly transformations: http://svn.osgeo.org/geotools/trunk/modules/unsupported/process-feature/src/main/java/org/geotools/process/feature/gs/ProcessingCollection.java http://svn.osgeo.org/geotools/trunk/modules/unsupported/process-feature/src/main/java/org/geotools/process/feature/gs/SimpleProcessingCollection.java<http://svn.osgeo.org/geotools/trunk/modules/unsupported/process-feature/src/main/java/org/geotools/process/feature/gs/ProcessingCollection.java> Here is a process that uses is internally, one does not need to write the process per se, it is sufficient to write the collection itself: http://svn.osgeo.org/geotools/trunk/modules/unsupported/process-feature/src/main/java/org/geotools/process/feature/gs/BufferFeatureCollection.java<http://svn.osgeo.org/geotools/trunk/modules/unsupported/process-feature/src/main/java/org/geotools/process/feature/gs/ProcessingCollection.java> and then feed the feature collection as the data source for a layer. Cheers Andrea -- Ing. Andrea Aime GeoSolutions S.A.S. Tech lead Via Poggio alle Viti 1187 55054 Massarosa (LU) Italy phone: +39 0584 962313 fax: +39 0584 962313 mob: +39 339 8844549 http://www.geo-solutions.it http://geo-solutions.blogspot.com/ http://www.youtube.com/user/GeoSolutionsIT http://www.linkedin.com/in/andreaaime http://twitter.com/geowolf |