Hey all. I'm using a process which takes a line geometry, buffers it and
creates a new feature. Then i intersect this new layer with a point layer
using the gs:IntersectionFeatureCollection. Two problems appear:

1. When the geometries actually intersect (buffer is big enough) all is well
but an exception gets thrown:


> TRACE [geotools.util] - Error applying the converter class
> org.geotools.util.GeometryConverterFactory$1 on (Tasmania,class
> com.vividsolutions.jts.geom.MultiPoint)
> com.vividsolutions.jts.io.ParseException: Unknown geometry type: Tasmania
> (line 1)
>       at
> com.vividsolutions.jts.io.WKTReader.parseErrorWithLine(WKTReader.java:427)
>       at
> com.vividsolutions.jts.io.WKTReader.readGeometryTaggedText(WKTReader.java:495)

2. When the geometries do not intersect, i get the same exception but also
an intersection feature (resulting gml) with empty geometry (the should be
no intersection feature?):


>  
> <gml:the_geom>
>                 
> <gml:MultiPoint srsName="http://www.opengis.net/gml/srs/epsg.xml#4326";>
>                     
> <gml:pointMember/>
>                 
> </gml:MultiPoint>
>             
> </gml:the_geom>

The WPS i'm executing is:


> <?xml version="1.0" encoding="UTF-8"?>
> <wps:Execute xmlns:wps="http://www.opengis.net/wps/1.0.0"; version="1.0.0"
> service="WPS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> xmlns="http://www.opengis.net/wps/1.0.0";
> xmlns:wfs="http://www.opengis.net/wfs";
> xmlns:ows="http://www.opengis.net/ows/1.1";
> xmlns:gml="http://www.opengis.net/gml";
> xmlns:ogc="http://www.opengis.net/ogc";
> xmlns:wcs="http://www.opengis.net/wcs/1.1.1";
> xmlns:xlink="http://www.w3.org/1999/xlink";
> xsi:schemaLocation="http://www.opengis.net/wps/1.0.0
> http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd";>
>     
> <ows:Identifier>
> gs:IntersectionFeatureCollection
> </ows:Identifier>
>     
> <wps:DataInputs>
>         
> <wps:Input>
>             
> <ows:Identifier>
> first feature collection
> </ows:Identifier>
>             
> <wps:Reference mimeType="text/xml; subtype=gml/3.1.1"
> xlink:href="http://geoserver/wps"; method="POST">
>                 
> <wps:Body>
>                     
> <wps:Execute version="1.0.0" service="WPS">
>                         
> <ows:Identifier>
> gs:Feature
> </ows:Identifier>
>                         
> <wps:DataInputs>
>                             
> <wps:Input>
>                                 
> <ows:Identifier>
> crs
> </ows:Identifier>
>                                 
> <wps:Data>
>                                     
> <wps:LiteralData>
> EPSG:4326
> </wps:LiteralData>
>                                 
> </wps:Data>
>                             
> </wps:Input>
>                             
> <wps:Input>
>                                 
> <ows:Identifier>
> typeName
> </ows:Identifier>
>                                 
> <wps:Data>
>                                     
> <wps:LiteralData>
> tasmania_roads_buffer_01
> </wps:LiteralData>
>                                 
> </wps:Data>
>                             
> </wps:Input>
>                             
> <wps:Input>
>                                 
> <ows:Identifier>
> geometry
> </ows:Identifier>
>                                 
> <wps:Reference mimeType="text/xml; subtype=gml/3.1.1"
> xlink:href="http://geoserver/wps"; method="POST">
>                                     
> <wps:Body>
>                                         
> <wps:Execute version="1.0.0" service="WPS">
>                                             
> <ows:Identifier>
> JTS:buffer
> </ows:Identifier>
>                                             
> <wps:DataInputs>
>                                                 
> <wps:Input>
>                                                     
> <ows:Identifier>
> distance
> </ows:Identifier>
>                                                     
> <wps:Data>
>                                                         
> <wps:LiteralData>
> 0.01
> </wps:LiteralData>
>                                                     
> </wps:Data>
>                                                 
> </wps:Input>
>                                                 
> <wps:Input>
>                                                     
> <ows:Identifier>
> geom
> </ows:Identifier>
>                                                     
> <wps:Reference mimeType="text/xml; subtype=gml/3.1.1"
> xlink:href="http://geoserver/wps"; method="POST">
>                                                         
> <wps:Body>
>                                                             
> <wps:Execute version="1.0.0" service="WPS">
>                                                                 
> <ows:Identifier>
> gs:CollectGeometries
> </ows:Identifier>
>                                                                 
> <wps:DataInputs>
>                                                                     
> <wps:Input>
>                                                                         
> <ows:Identifier>
> features
> </ows:Identifier>
>                                                                         
> <wps:Reference mimeType="text/xml" xlink:href="http://geoserver/wfs";
> method="POST">
>                                                                             
> <wps:Body>
>                                                                               
>   
> <wfs:GetFeature xmlns:gurs="http://www.gurs.com"; service="WFS"
> version="1.0.0" outputFormat="GML2">
>                                                                               
>       
> <wfs:Query typeName="topp:tasmania_roads"/>
>                                                                               
>   
> </wfs:GetFeature>
>                                                                             
> </wps:Body>
>                                                                         
> </wps:Reference>
>                                                                     
> </wps:Input>
>                                                                 
> </wps:DataInputs>
>                                                                 
> <wps:ResponseForm>
>                                                                     
> <wps:RawDataOutput mimeType="text/xml; subtype=gml/2.1.2">
>                                                                         
> <ows:Identifier>
> result
> </ows:Identifier>
>                                                                     
> </wps:RawDataOutput>
>                                                                 
> </wps:ResponseForm>
>                                                             
> </wps:Execute>
>                                                         
> </wps:Body>
>                                                     
> </wps:Reference>
>                                                 
> </wps:Input>
>                                             
> </wps:DataInputs>
>                                             
> <wps:ResponseForm>
>                                                 
> <wps:RawDataOutput mimeType="text/xml; subtype=gml/2.1.2">
>                                                     
> <ows:Identifier>
> result
> </ows:Identifier>
>                                                 
> </wps:RawDataOutput>
>                                             
> </wps:ResponseForm>
>                                         
> </wps:Execute>
>                                     
> </wps:Body>
>                                 
> </wps:Reference>
>                             
> </wps:Input>
>                         
> </wps:DataInputs>
>                         
> <wps:ResponseForm>
>                             
> <wps:RawDataOutput mimeType="text/xml; subtype=wfs-collection/1.0">
>                                 
> <ows:Identifier>
> result
> </ows:Identifier>
>                             
> </wps:RawDataOutput>
>                         
> </wps:ResponseForm>
>                     
> </wps:Execute>
>                 
> </wps:Body>
>             
> </wps:Reference>
>         
> </wps:Input>
>         
> <wps:Input>
>             
> <ows:Identifier>
> second feature collection
> </ows:Identifier>
>             
> <wps:Reference mimeType="text/xml" xlink:href="http://geoserver/wfs";
> method="POST">
>                 
> <wps:Body>
>                     
> <wfs:GetFeature xmlns:gurs="http://www.gurs.com"; service="WFS"
> version="1.0.0" outputFormat="GML2">
>                         
> <wfs:Query typeName="topp:tasmania_cities"/>
>                     
> </wfs:GetFeature>
>                 
> </wps:Body>
>             
> </wps:Reference>
>         
> </wps:Input>
>         
> <wps:Input>
>             
> <ows:Identifier>
> intersectionMode
> </ows:Identifier>
>             
> <wps:Data>
>                 
> <wps:LiteralData>
> INTERSECTION
> </wps:LiteralData>
>             
> </wps:Data>
>         
> </wps:Input>
>     
> </wps:DataInputs>
>     
> <wps:ResponseForm>
>         
> <wps:RawDataOutput mimeType="text/xml; subtype=wfs-collection/1.0">
>             
> <ows:Identifier>
> result
> </ows:Identifier>
>         
> </wps:RawDataOutput>
>     
> </wps:ResponseForm>
> </wps:Execute>

Geoserver is 2.5.2. So is this a feature or a bug?

One potential problem i see is that in IntersectionFeatureCollection.java
there is only a simple check:


> if (((Geometry) attribute).getNumGeometries() > 0) {

but no check like:


> ((Geometry) attribute).isEmpty()





--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/WPS-problem-2-5-2-tp5167597.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to