Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit99e9275

Browse files
authored
Refactor Neo4jSpatialFeatureReader to use ECQL instead of CQL and improve error handling to preventCQL requires a PropertyName Error (#453)
1 parent83d58dc commit99e9275

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

‎server-plugin/src/main/java/org/geotools/data/neo4j/Neo4jSpatialFeatureReader.java‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,14 @@
2727
importjava.util.Map;
2828
importjava.util.NoSuchElementException;
2929
importjava.util.Optional;
30-
importjava.util.logging.Logger;
3130
importorg.geotools.api.data.Query;
3231
importorg.geotools.api.data.SimpleFeatureReader;
3332
importorg.geotools.api.data.Transaction;
3433
importorg.geotools.api.feature.simple.SimpleFeature;
3534
importorg.geotools.api.feature.simple.SimpleFeatureType;
3635
importorg.geotools.api.feature.type.AttributeDescriptor;
3736
importorg.geotools.feature.simple.SimpleFeatureBuilder;
38-
importorg.geotools.filter.text.cql2.CQL;
37+
importorg.geotools.filter.text.ecql.ECQL;
3938
importorg.locationtech.jts.geom.Coordinate;
4039
importorg.locationtech.jts.geom.Geometry;
4140
importorg.locationtech.jts.geom.GeometryFactory;
@@ -51,7 +50,6 @@
5150

5251
publicclassNeo4jSpatialFeatureReaderimplementsSimpleFeatureReader {
5352

54-
privatestaticfinalLoggerLOGGER =org.geotools.util.logging.Logging.getLogger(Neo4jSpatialFeatureReader.class);
5553
privatestaticfinalStringGEOMETRY ="geom";
5654
privatestaticfinalStringATTRIBUTES ="attributes";
5755
privatestaticfinalStringNODE ="node";
@@ -103,7 +101,7 @@ protected void initialize() {
103101
Statementstatement =Cypher.call("spatial.cql")
104102
.withArgs(
105103
layerParam,
106-
Cypher.parameter("cql",CQL.toCQL(query.getFilter()))
104+
Cypher.parameter("cql",ECQL.toCQL(query.getFilter()))
107105
)
108106
.yield(node)
109107
.returning(
@@ -123,9 +121,9 @@ protected void initialize() {
123121
.build();
124122
this.result =dataStore.executeQuery(statement,transaction).iterator();
125123

126-
}catch (Exceptione) {
127-
LOGGER.warning(e.getMessage());
124+
}catch (RuntimeExceptione) {
128125
close();
126+
thrownewIllegalStateException("Error initializing feature reader",e);
129127
}
130128
}
131129

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp