The trouble with sending me email personally is not so much being annoying; as 
not sharing your question with the user list. Sharing questions is one of the 
*minimal* contributions you can make to an open source project; and open source 
projects only thrive (and are there for you to build your work on when everyone 
contributes something).

A quick answer is to copy the data into memory:

DataUtilities.collection( collection ).toArray();

Cheers,
Jody

On 17/05/2011, at 1:17 AM, robert benjamin shimirwa wrote:

hello it's me again,
i know it might be annoying to respond to each of the geotool users who writes 
to you directly, but this is among my few last mails directly in your mailbox  
i'd really appreciate an effort from you to respond this email. i need help on 
how i could get an array of object of each feature in the featurecollection. i 
have tried the FeatureCollection.getArray() method but i have this runtime 
Exception:

 java.lang.UnsupportedOperationException
        at 
org.geotools.data.store.ContentFeatureCollection.toArray(ContentFeatureCollection.java:379)



________________________________
From: [email protected]<mailto:[email protected]>
To: [email protected]<mailto:[email protected]>
CC: 
[email protected]<mailto:[email protected]>
Date: Tue, 10 May 2011 16:16:38 +1000
Subject: FeatureCollection serialisation

I am taking your email to the geotools user list; in a public forum you are 
likely to get your question answered more promptly.

The quick solution is to go through the features; and ask each for its array of 
objects; and serialise those. You can use the data utilities class to convert 
the feature type information into a String (so you can create the features on 
the other end to hold the result).

The more "correct" solution is to make use of a spatial format such as GeoJSON 
or GML; there are some examples in the user guide.

In General GeoTools just provides the spatial stuff; leaving things like 
communication up to your application.

Jody

On 09/05/2011, at 11:58 PM, robert benjamin shimirwa wrote:


hello,
yesterday i have sent you a mail describing that i was trying to move 
org.geotools.data.DataStore through the java.rmi communication, but i have 
figured out that no one of org.geotools interfaces implements the 
java.io.Serialize interface; now i am wondering if maybe you could flash me 
with some ideas and code examples if possible.

my name is Robert, i am a Rwandan student in Algeria, i am to develop  GIS as 
final project for my studies. i hope to find some help from you.

________________________________
From: [email protected]<mailto:[email protected]>
To: [email protected]<mailto:[email protected]>
Subject: geotools user
Date: Sun, 8 May 2011 16:46:20 +0100



hello sir,
I'm a user of geotools and today i found out that rmi communication was not 
possible. i'm to develop GIS with PostGIS as database and a geotools client, 
communicating via java rmi. but i am having errors like this:
 org.geotools.data.store.ContentFeatureCollection
        at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:173),
i thing dataStore and featureCollection interfaces are not extending 
serialisable, i saw you are soo experimented in this project that's why i 
choosed to write directly to you. thanks again for your comprehension. i'll be 
a pleasure to hear from you.



------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to