2727import java .util .Map ;
2828import java .util .NoSuchElementException ;
2929import java .util .Optional ;
30- import java .util .logging .Logger ;
3130import org .geotools .api .data .Query ;
3231import org .geotools .api .data .SimpleFeatureReader ;
3332import org .geotools .api .data .Transaction ;
3433import org .geotools .api .feature .simple .SimpleFeature ;
3534import org .geotools .api .feature .simple .SimpleFeatureType ;
3635import org .geotools .api .feature .type .AttributeDescriptor ;
3736import org .geotools .feature .simple .SimpleFeatureBuilder ;
38- import org .geotools .filter .text .cql2 . CQL ;
37+ import org .geotools .filter .text .ecql . ECQL ;
3938import org .locationtech .jts .geom .Coordinate ;
4039import org .locationtech .jts .geom .Geometry ;
4140import org .locationtech .jts .geom .GeometryFactory ;
5150
5251public class Neo4jSpatialFeatureReader implements SimpleFeatureReader {
5352
54- private static final Logger LOGGER =org .geotools .util .logging .Logging .getLogger (Neo4jSpatialFeatureReader .class );
5553private static final String GEOMETRY ="geom" ;
5654private static final String ATTRIBUTES ="attributes" ;
5755private static final String NODE ="node" ;
@@ -103,7 +101,7 @@ protected void initialize() {
103101Statement statement =Cypher .call ("spatial.cql" )
104102.withArgs (
105103layerParam ,
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 ();
124122this .result =dataStore .executeQuery (statement ,transaction ).iterator ();
125123
126- }catch (Exception e ) {
127- LOGGER .warning (e .getMessage ());
124+ }catch (RuntimeException e ) {
128125close ();
126+ throw new IllegalStateException ("Error initializing feature reader" ,e );
129127}
130128}
131129