Skip to content

Commit

Permalink
[GEOS-11503] Update mongo schemaless DWITHIN to support non-point geo…
Browse files Browse the repository at this point in the history
…metry
  • Loading branch information
Mike7311 authored and aaime committed Aug 26, 2024
1 parent f797f29 commit 40cb15d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import org.geoserver.schemalessfeatures.mongodb.MongoSchemalessUtils;
import org.geoserver.schemalessfeatures.mongodb.filter.MongoTypeFinder;
import org.geoserver.schemalessfeatures.mongodb.filter.SchemalessFilterToMongo;
import org.geoserver.schemalessfeatures.type.DynamicFeatureType;
import org.geotools.api.data.FeatureReader;
import org.geotools.api.data.Query;
import org.geotools.api.data.QueryCapabilities;
Expand Down Expand Up @@ -188,8 +187,7 @@ DBObject toQuery(Filter f) {
SimpleReprojectingVisitor reprojectingFilterVisitor = new SimpleReprojectingVisitor();
f = (Filter) f.accept(reprojectingFilterVisitor, null);

SchemalessFilterToMongo v =
new SchemalessFilterToMongo((DynamicFeatureType) getSchema(), collection);
SchemalessFilterToMongo v = new SchemalessFilterToMongo(getSchema(), collection);

return (DBObject) f.accept(v, null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import com.mongodb.DBObject;
import com.mongodb.client.MongoCollection;
import org.geoserver.schemalessfeatures.mongodb.MongoSchemalessUtils;
import org.geoserver.schemalessfeatures.type.DynamicFeatureType;
import org.geotools.api.feature.type.FeatureType;
import org.geotools.api.filter.expression.Expression;
import org.geotools.api.filter.expression.PropertyName;
import org.geotools.data.mongodb.AbstractFilterToMongo;
Expand All @@ -17,12 +17,9 @@ public class SchemalessFilterToMongo extends AbstractFilterToMongo {

private MongoTypeFinder typeFinder;

private DynamicFeatureType featureType;

public SchemalessFilterToMongo(
DynamicFeatureType featureType, MongoCollection<DBObject> collection) {
public SchemalessFilterToMongo(FeatureType featureType, MongoCollection<DBObject> collection) {
super();
this.featureType = featureType;
setFeatureType(featureType);
this.typeFinder = new MongoTypeFinder(featureType.getName(), collection);
}

Expand Down

0 comments on commit 40cb15d

Please sign in to comment.