Hi Martin and Andrea,

sorry for the late of my reply but I've had some troubles in these days and
I was out of office.

First of all I try to explain what I'd like to do with my WPS process.

I've tried to reply the steps using QGIS on the same data (shapefile) and
capture images:

1) select a state (Texas): figure SelectedState-TX.jpg
2) calculate a buffer around the selected state: figure
BufferAroundSelectedStateTX.jpg
3) intersect this buffer with the state layer and find the states that
interscet the buffer: figure StateIntersect.jpg

Note the I'd like to use the buffer to intersect other layers too.

I hope in this manner could be clear my goal.

So can I obtain my goal using my original WPS process? Other ways? The only
thing that I've to do is update my GeoServer?
Here you are the build infomation about my GeoServer:

   - Version 2.1-SNAPSHOT
   - Subversion Revision 16780
   - Build Date 22-Feb-2012 05:02
   - GeoTools Version 2.7-SNAPSHOT (rev 38575)

Another question: the gs:CollectGeometries works fine but if I've a "real"
layers with a lot of features (> 1000), is good too?

Thank you in advance...

 Cesare

2012/6/22 Martin Davis <mda...@opengeo.org>

>
>
> On Thu, Jun 21, 2012 at 1:05 PM, Andrea Aime <andrea.a...@geo-solutions.it
> > wrote:
>
>> On Thu, Jun 21, 2012 at 8:17 PM, Martin Davis <mda...@opengeo.org> wrote:
>>
>>> The reason for the exception is that the JTS intersection operation only
>>> works on valid geometries.  Unfortunately the output of the
>>> gs:CollectGeometries process may not be valid in the case where it is
>>> collecting a set of Polygons.  This is because polygons which are adjacent
>>> to each other or which overlap do not form valid MultiPolygons.  Both of
>>> these situations occur in your process (the input states are adjacent, and
>>> the buffers will overlap).
>>
>>
>> The current version of collectGeometries now does a union before
>> returning polygon collections, I guess you haven't used it in a few months,
>> the
>> change has been made in March (http://jira.codehaus.org/browse/GEOT-4077)
>>
>> However this might explain why Cesare's case is not working, I believe he
>> has a 2.1.3 installed.
>>
>
> Oh, right, I see that now.  It should probably use the newish JTS
> Geometry.union() rather than buffer(0) - it's faster for large datasets.
>
>>
>>
>>>
>>> Actually the buffer operation should work with any kind of input, and
>>> produce a valid polygonal output.  So the problem is due to collecting the
>>> STATES polygons together and trying to use that in JTS:intersection.
>>>
>>> In fact, the JTS:intersection operation is not designed to work on
>>> collections of geometries anyway.
>>>
>>
>> The gs:CollectGeometries process made sure to build a type specific
>> collection for that very reason, you will get back
>> a GeometryCollection only if the collected geometries are etherogeneous:
>>
>> http://svn.osgeo.org/geotools/trunk/modules/library/main/src/main/java/org/geotools/geometry/jts/GeometryCollector.java
>>
>> Or do you mean that intersecting a Multipolygon against another
>> Multipolygon is less robust than an intersection
>> between simple polygons?
>>
>
> I mean that in order for the intersection to work, both arguments need to
> be valid geometries.  In the case of the states collection, this requires
> that they be unioned together.  The effect of this is to produce a single
> polygon (the outline of the US).  Then the result of the intersection is
> going to be a single polygon.  I took a guess that the desire result was
> actually a collection of the intersections of the individual state polygons
> against the buffer polygon (this is the most common reason for this kind of
> processing, in my experience).
>
>>
>>
>>>
>>> --
> Martin Davis
> OpenGeo - http://opengeo.org
> Expert service straight from the developers.
>
>


-- 
Cesare Gerbino

<<attachment: SelectedState-TX.jpg>>

<<attachment: BufferAroundSelectedStateTX.jpg>>

<<attachment: StateIntersect.jpg>>

------------------------------------------------------------------------------
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
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to