Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[udig-devel] Geometry Filters

Hi.

I'm working about geometry filters. I'm trying to implement the
intersection and contain filters using geometry filters of geotools. This is really
efficient but results are "wrong" (for me).

For example, if you try to calculate the features (polygon type)
which are into a specific geometry (polygon) with the contain filter, you'll obtain
the inner geometries and the outter adjacent geometries because these share
some edge with the container geometry (polygon).

The intersection filter has the same "problem". The result of this operation returns
the feature geometries which intersect with the specified polygon and the feature geometries
which share some edge with the polygon (because the geometries share some edge so
these intersect). I don't wanna obtain these last features.

The wished result would be only the inner features of the polygon. I don't wanna
obtain the features wich intersect with the polygon respectively.

I'm using the next code:

> GeometryFilter result;
> result = filterFactory.createGeometryFilter(AbstractFilter.GEOMETRY_INTERSECTS);
> _expression_ geoExp = filterFactory.createLiteralExpression(geom);  // geom is the geometry 'container'
> _expression_ attExp = filterFactory.createAttributeExpression("the_geom");
> result.addLeftGeometry(geoExp);
> result.addRightGeometry(attExp);

The built filter is used to obtain a filtered feature collection.


Ah! Sometimes I find errors like these:

> com.vividsolutions.jts.geom.TopologyException: side location conflict [ (171416.22257803185, 4184304.665219386, NaN) ]


I think this exception is thrown because of bad built geometries/features. Of course, this is a JTS error.

 


Questions:


*** Could somebody say me if this problem has a solution using only geotool filters?

*** Should I solve the problem working with JTS directly?

*** Could somebody say me if there is a method to solve the last error (Exception)?

 
Thank's for your help.


Back to the top