Hi, Andrea,
thanks for your quick response. In my class "KMLPPIO", I'm doing
something like:
public void encode(Object value, OutputStream os) throws IOException {
CRSAuthorityFactory factory = CRS.getAuthorityFactory(true);
CoordinateReferenceSystem targetCRS;
try {
targetCRS =
factory.createCoordinateReferenceSystem("EPSG:4326");
value = new
ReprojectingFeatureCollection((FeatureCollection)value, targetCRS);
Encoder encoder = new Encoder(new KMLConfiguration());
encoder.setIndenting(true);
encoder.encode((FeatureCollection) value, KML.kml, os);
} catch (NoSuchAuthorityCodeException e1) {
LOGGER.warning(e1.toString());
} catch (FactoryException e1) {
LOGGER.warning(e1.toString());
} catch (IOException e) {
LOGGER.warning(e.getMessage());
LOGGER.warning(e.getStackTrace().toString());
throw e;
}
}
.
This fails with:
23 Aug 11:20:56 ERROR [geoserver.ows] -
org.geoserver.wps.WPSException: An error occurred while encoding the
results of the process
at
org.geoserver.wps.response.ExecuteProcessResponse.writeComplex(ExecuteProcessResponse.java:212)
at
org.geoserver.wps.response.ExecuteProcessResponse.write(ExecuteProcessResponse.java:174)
at org.geoserver.ows.Dispatcher.response(Dispatcher.java:751)
at
org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:238)
(...)
Caused by: java.lang.RuntimeException: Failed to get property: id
at
org.geotools.xml.impl.GetPropertyExecutor.visit(GetPropertyExecutor.java:104)
at
org.geotools.xml.impl.BindingWalker$BindingExecutionChain.execute(BindingWalker.java:215)
at org.geotools.xml.impl.BindingWalker.walk(BindingWalker.java:181)
at
org.geotools.xml.impl.BindingVisitorDispatch.walk(BindingVisitorDispatch.java:46)
at
org.geotools.xml.impl.BindingVisitorDispatch.walk(BindingVisitorDispatch.java:31)
at org.geotools.xml.Encoder.encode(Encoder.java:861)
at org.geotools.xml.Encoder.encode(Encoder.java:566)
at org.geoserver.wps.ppio.KMLPPIO.encode(KMLPPIO.java:51)
at
org.geoserver.wps.CDataEncoderDelegate.encode(CDataEncoderDelegate.java:52)
at
org.geoserver.wps.response.ExecuteProcessResponse.writeComplex(ExecuteProcessResponse.java:210)
... 68 more
Caused by: java.lang.UnsupportedOperationException
at
org.geotools.data.store.ContentFeatureCollection.getID(ContentFeatureCollection.java:493)
at
org.geotools.feature.collection.DecoratingSimpleFeatureCollection.getID(DecoratingSimpleFeatureCollection.java:195)
at
org.geotools.kml.bindings.FeatureTypeBinding.getProperty(FeatureTypeBinding.java:193)
at
org.geotools.xml.impl.GetPropertyExecutor.visit(GetPropertyExecutor.java:102)
I do not know, how to avoid this.
Peter
On 08/27/2012 04:49 PM, Andrea Aime wrote:
On Mon, Aug 27, 2012 at 4:04 PM, Peter Hopfgartner
<[email protected] <mailto:[email protected]>>
wrote:
Hello
some of the WPS processes (like ReprojectProcess) bring an object of
class org.geotools.data.store.ContentFeatureCollection into my PPIO,
others an object of class
org.geotools.feature.DefaultFeatureCollection
(like BufferFeatureCollection).
Where is the returned class implementing GeoServerProcess, which
in one
case is BufferedFeatureCollection, in the other of type
ReprojectingFeatureCollection converted to
org.geotools.data.store.ContentFeatureCollection or
org.geotools.feature.DefaultFeatureCollection?
Long story short, never have PPIO handle a specific feature follection
implementation
class, those can change, always work against the
FatureCollection/SimpleFeatureCollection
interfaces
Cheers
Andrea
--
==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for
more information.
==
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
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://twitter.com/geosolutions_it
-------------------------------------------------------
--
Peter Hopfgartner
R3 GIS Srl - GmbH
Via Johann Kravogl-Str. 2
I-39012 Meran/Merano (BZ)
web : www.r3-gis.com
mail : [email protected]
phone: +39 0473 494949
fax : +39 0473 069902
ATTENZIONE! Le informazioni contenute nella presente e-mail e nei documenti
eventualmente allegati sono confidenziali. La loro diffusione, distribuzione
e/o riproduzione da parte di terzi, senza autorizzazione del mittente è vietata
e può violare il D. Lgs. 196/2003. In caso di ricezione per errore, Vogliate
immediatamente informare il mittente del messaggio e distruggere la e-mail.
ACHTUNG! Die in dieser Nachricht oder in den beigelegten Dokumenten
beinhalteten Informationen sind streng vertraulich. Ihre Verbreitung und/oder
ihre Wiedergabe durch Dritte ist ohne Erlaubnis des Absenders verboten und
verstößt gegen das Legislativdekret 196/2003. Sollten Sie diese Mitteilung
irrtümlicherweise erhalten haben, bitten wir Sie uns umgehend zu informieren
und anschließend die Mitteilung zu vernichten.
WARNING! This e-mail may contain confidential and/or privileged information. If
you are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any unauthorised
copying, disclosure or distribution of the material in this e-mail is strictly
forbidden and could be against the law (D. Lgs. 196/2003)
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users