From: mounir y. <mou...@gm...> - 2011-04-29 09:12:42
|
question 1: What does the assertEquals() and strip() methods do ? And I want to send a feature collection with an OutputStream (DataOutputStream or ObjectOutputStream) so should I do the following? FeatureJSON fjson = new FeatureJSON(); StringWriter writer = new StringWriter(); fjson.writeFeatureCollection(collection(), writer); //question 2 - does this take the collection and return it as a string and put it in string writer ? If yes ! does this mean that I can simply send it as a string over the network ? at the other end what should I read and how? fjson.readFeatureCollection() ? should I implement the collectionText() method ? if yes what does the withBounds parameter mean ? Thank you :) I hope the answer for these questions would help others :) On Mon, Apr 25, 2011 at 11:34 AM, Andrea Aime <and...@ge...>wrote: > On Mon, Apr 25, 2011 at 6:13 AM, Jody Garnett <jod...@gm...> > wrote: > > The work with a java Writer; use your http connection and wrap it up as a > > writer on one end; and a reader on the other; and use these two methods > as > > shown above: > > > > - readFeatureCollection( reader ) > > > > - writeFeatureCollection( featureCollection, writer ) > > > > Or send a string over the wire (using whatever remoting software you are > > happy with ) and use a StringWriter as shown in the test case to generate > > your string on one side; and a StringReader on the other end. > > To send over http you can use either commons http or use the built in Java > abilities. If you go for the latter the bits of code in the > resourceToStream method > in this class might be of help (this is the receiving end, the other > half is similar), > in particular if the network is slow it shows how to use http 1.1 gzip > compression > to speed up the transfer: > > > http://svn.osgeo.org/geotools/trunk/modules/unsupported/sfs/src/main/java/org/geotools/data/sfs/SFSDataStore.java > > 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 > > 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 > > ------------------------------------------------------- > |