diff --git a/pom.xml b/pom.xml index 21d13563c..4958bff7c 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.neo4j.maven.skins default-skin 2 - 14.4 + 21.0 20100819 20100819 org.neo4j.gis @@ -21,7 +21,7 @@ 4.0.0 neo4j-spatial org.neo4j - 0.26.2-neo4j-3.5.2 + 0.27-neo4j-3.5.2 Neo4j - Spatial Components Spatial utilities and components for Neo4j http://components.neo4j.org/${project.artifactId}/${project.version} diff --git a/src/main/java/org/geotools/data/neo4j/Neo4jFeatureBuilder.java b/src/main/java/org/geotools/data/neo4j/Neo4jFeatureBuilder.java index 13d3b4a61..417c69249 100644 --- a/src/main/java/org/geotools/data/neo4j/Neo4jFeatureBuilder.java +++ b/src/main/java/org/geotools/data/neo4j/Neo4jFeatureBuilder.java @@ -30,7 +30,7 @@ import org.geotools.feature.simple.SimpleFeatureBuilder; import org.geotools.feature.simple.SimpleFeatureTypeBuilder; import org.geotools.feature.type.BasicFeatureTypes; -import org.geotools.resources.Classes; +import org.geotools.util.Classes; import org.neo4j.gis.spatial.Layer; import org.neo4j.gis.spatial.SpatialDatabaseService; import org.neo4j.gis.spatial.SpatialRecord; @@ -41,14 +41,14 @@ import org.opengis.feature.type.GeometryType; import org.opengis.referencing.crs.CoordinateReferenceSystem; -import com.vividsolutions.jts.geom.Geometry; -import com.vividsolutions.jts.geom.LineString; -import com.vividsolutions.jts.geom.LinearRing; -import com.vividsolutions.jts.geom.MultiLineString; -import com.vividsolutions.jts.geom.MultiPoint; -import com.vividsolutions.jts.geom.MultiPolygon; -import com.vividsolutions.jts.geom.Point; -import com.vividsolutions.jts.geom.Polygon; +import org.locationtech.jts.geom.Geometry; +import org.locationtech.jts.geom.LineString; +import org.locationtech.jts.geom.LinearRing; +import org.locationtech.jts.geom.MultiLineString; +import org.locationtech.jts.geom.MultiPoint; +import org.locationtech.jts.geom.MultiPolygon; +import org.locationtech.jts.geom.Point; +import org.locationtech.jts.geom.Polygon; public class Neo4jFeatureBuilder { diff --git a/src/main/java/org/geotools/data/neo4j/Neo4jSpatialDataStore.java b/src/main/java/org/geotools/data/neo4j/Neo4jSpatialDataStore.java index 9ba84d019..44d141bd9 100644 --- a/src/main/java/org/geotools/data/neo4j/Neo4jSpatialDataStore.java +++ b/src/main/java/org/geotools/data/neo4j/Neo4jSpatialDataStore.java @@ -1,467 +1,82 @@ /** * Copyright (c) 2010-2017 "Neo Technology," * Network Engine for Objects in Lund AB [http://neotechnology.com] - * * This file is part of Neo4j Spatial. - * * Neo4j is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package org.geotools.data.neo4j; -import java.io.File; -import java.io.FileReader; -import java.io.IOException; -import java.io.StringReader; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.geotools.data.AbstractDataStore; -import org.geotools.data.AbstractFeatureLocking; -import org.geotools.data.AbstractFeatureStore; -import org.geotools.data.DataStore; -import org.geotools.data.FeatureListener; -import org.geotools.data.FeatureReader; -import org.geotools.data.FeatureWriter; -import org.geotools.data.FilteringFeatureWriter; -import org.geotools.data.InProcessLockingManager; import org.geotools.data.Query; -import org.geotools.data.ResourceInfo; -import org.geotools.data.TransactionStateDiff; import org.geotools.data.simple.SimpleFeatureSource; -import org.geotools.filter.FidFilterImpl; +import org.geotools.data.store.ContentDataStore; +import org.geotools.data.store.ContentEntry; +import org.geotools.data.store.ContentFeatureSource; +import org.geotools.feature.NameImpl; import org.geotools.geometry.jts.ReferencedEnvelope; -import org.geotools.styling.SLDParser; import org.geotools.styling.Style; -import org.geotools.styling.StyleFactory; -import org.geotools.styling.StyleFactoryImpl; -import org.neo4j.gis.spatial.rtree.filter.SearchAll; -import org.neo4j.gis.spatial.rtree.filter.SearchFilter; import org.neo4j.gis.spatial.Constants; -import org.neo4j.gis.spatial.EditableLayer; import org.neo4j.gis.spatial.Layer; -import org.neo4j.gis.spatial.SpatialDatabaseRecord; import org.neo4j.gis.spatial.SpatialDatabaseService; -import org.neo4j.gis.spatial.Utilities; -import org.neo4j.gis.spatial.filter.SearchCQL; -import org.neo4j.gis.spatial.filter.SearchRecords; import org.neo4j.graphdb.GraphDatabaseService; import org.neo4j.graphdb.Transaction; -import org.opengis.feature.simple.SimpleFeature; import org.opengis.feature.simple.SimpleFeatureType; -import org.opengis.filter.Filter; +import org.opengis.feature.type.Name; import org.opengis.referencing.crs.CoordinateReferenceSystem; -import com.vividsolutions.jts.geom.Envelope; - +import java.util.*; /** * Geotools DataStore implementation. - * + * * @author Davide Savazzi */ -public class Neo4jSpatialDataStore extends AbstractDataStore implements Constants { +public class Neo4jSpatialDataStore extends ContentDataStore implements Constants { - // Constructor - - public Neo4jSpatialDataStore(GraphDatabaseService database) { - super(true); - - this.database = database; + private SpatialDatabaseService spatialDatabase; + + public Neo4jSpatialDataStore(GraphDatabaseService database) { this.spatialDatabase = new SpatialDatabaseService(database); - } - - - // Public methods - - /** - * Return list of not-empty Layer names. - * The list is cached in memory. - * - * @return layer names - */ - public String[] getTypeNames() throws IOException { - if (typeNames == null) { - try (Transaction tx = database.beginTx()) { - List notEmptyTypes = new ArrayList(); - String[] allTypeNames = spatialDatabase.getLayerNames(); - for (int i = 0; i < allTypeNames.length; i++) { - // discard empty layers - System.out.print("loading layer " + allTypeNames[i]); - Layer layer = spatialDatabase.getLayer(allTypeNames[i]); - if (!layer.getIndex().isEmpty()) { - notEmptyTypes.add(allTypeNames[i]); - } - } - typeNames = notEmptyTypes.toArray(new String[]{}); - tx.success(); - } - } - return typeNames; } - - /** - * Return FeatureType of the given Layer. - * FeatureTypes are cached in memory. - */ - public SimpleFeatureType getSchema(String typeName) throws IOException { - SimpleFeatureType result = simpleFeatureTypeIndex.get(typeName); - if (result == null) { - Layer layer = spatialDatabase.getLayer(typeName); - if (layer == null) { - throw new IOException("Layer not found: " + typeName); - } - - try (Transaction tx = database.beginTx()) { - result = Neo4jFeatureBuilder.getTypeFromLayer(layer); - simpleFeatureTypeIndex.put(typeName, result); - tx.success(); - } - } - return result; - } - - /** - * Return a FeatureSource implementation. - * A FeatureSource can be used to retrieve Layer metadata, bounds and geometries. - */ @Override - public SimpleFeatureSource getFeatureSource(String typeName) throws IOException { - SimpleFeatureSource result = featureSourceIndex.get(typeName); - if (result == null) { - final SimpleFeatureType featureType = getSchema(typeName); - - if (getLockingManager() != null) { - System.out.println("getFeatureSource(" + typeName + ") - locking manager is present"); - - result = new AbstractFeatureLocking(getSupportedHints()) { - public DataStore getDataStore() { - return Neo4jSpatialDataStore.this; - } - - public void addFeatureListener(FeatureListener listener) { - listenerManager.addFeatureListener(this, listener); - } - - public void removeFeatureListener(FeatureListener listener) { - listenerManager.removeFeatureListener(this, listener); - } - - public SimpleFeatureType getSchema() { - return featureType; - } - - public ReferencedEnvelope getBounds() throws IOException { - return Neo4jSpatialDataStore.this.getBounds(featureType.getTypeName()); - } - - public ResourceInfo getInfo() { - return Neo4jSpatialDataStore.this.getInfo(featureType.getTypeName()); - } - }; - } else { - System.out.println("getFeatureSource(" + typeName + ") - locking manager is NOT present"); - - result = new AbstractFeatureStore(getSupportedHints()) { - public DataStore getDataStore() { - return Neo4jSpatialDataStore.this; - } - - public void addFeatureListener(FeatureListener listener) { - listenerManager.addFeatureListener(this, listener); - } - - public void removeFeatureListener(FeatureListener listener) { - listenerManager.removeFeatureListener(this, listener); - } - - public SimpleFeatureType getSchema() { - return featureType; - } - - public ReferencedEnvelope getBounds() throws IOException { - return Neo4jSpatialDataStore.this.getBounds(featureType.getTypeName()); - } - - public ResourceInfo getInfo() { - return Neo4jSpatialDataStore.this.getInfo(featureType.getTypeName()); - } - }; - } - - featureSourceIndex.put(typeName, result); - } - - return result; - } - - /* public FeatureWriter getFeatureWriterAppend(String typeName, org.geotools.data.Transaction transaction) throws IOException { - FeatureWriter writer = getFeatureWriter(typeName, Filter.EXCLUDE, transaction); - while (writer.hasNext()) { - writer.next(); - } - return writer; - } */ - - public FeatureWriter getFeatureWriter(String typeName, Filter filter, org.geotools.data.Transaction transaction) throws IOException { - if (filter == null) { - throw new NullPointerException("getFeatureReader requires Filter: did you mean Filter.INCLUDE?"); - } - - if (transaction == null) { - throw new NullPointerException("getFeatureWriter requires Transaction: did you mean to use Transaction.AUTO_COMMIT?"); - } - - System.out.println("getFeatureWriter(" + typeName + "," + filter.getClass() + " " + filter + "," + transaction + ")"); - - FeatureWriter writer; - - if (transaction == org.geotools.data.Transaction.AUTO_COMMIT) { - try { - writer = createFeatureWriter(typeName, filter, transaction); - } catch (UnsupportedOperationException e) { - // this is for backward compatibility - try { - writer = getFeatureWriter(typeName, transaction); - } catch (UnsupportedOperationException eek) { - throw e; // throw original - our fallback did not work - } - } - } else { - TransactionStateDiff state = state(transaction); - if (state != null) { - writer = state.writer(typeName, filter); - } else { - throw new UnsupportedOperationException("not implemented..."); - } - } - - if (getLockingManager() != null) { - writer = ((InProcessLockingManager) getLockingManager()).checkedWriter(writer, transaction); - } - - if (filter != Filter.INCLUDE) { - writer = new FilteringFeatureWriter(writer, filter); - } - - return writer; - } - - public ReferencedEnvelope getBounds(String typeName) { - ReferencedEnvelope result = boundsIndex.get(typeName); - if (result == null) { - Layer layer = spatialDatabase.getLayer(typeName); - if (layer != null) { - try (Transaction tx = database.beginTx()) { - Envelope bbox = Utilities.fromNeo4jToJts(layer.getIndex().getBoundingBox()); - result = convertEnvelopeToRefEnvelope(typeName, bbox); - boundsIndex.put(typeName, result); - tx.success(); + protected List createTypeNames() { + List notEmptyTypes = new ArrayList<>(); + try (Transaction tx = spatialDatabase.getDatabase().beginTx()) { + String[] allTypeNames = spatialDatabase.getLayerNames(); + for (int i = 0; i < allTypeNames.length; i++) { + // discard empty layers + LOGGER.info("loading layer " + allTypeNames[i]); + Layer layer = spatialDatabase.getLayer(allTypeNames[i]); + if (!layer.getIndex().isEmpty()) { + notEmptyTypes.add(name(allTypeNames[i])); } - } - } - return result; - } - - public SpatialDatabaseService getSpatialDatabaseService() { - return spatialDatabase; - } - - public Transaction beginTx() { - return database.beginTx(); - } - - public void clearCache() { - typeNames = null; - simpleFeatureTypeIndex.clear(); - crsIndex.clear(); - styleIndex.clear(); - boundsIndex.clear(); - featureSourceIndex.clear(); - } - - public void dispose() { - database.shutdown(); - - super.dispose(); - } - - - // Private methods - - protected FeatureReader getFeatureReader(String typeName, Query query) throws IOException { - System.out.println("getFeatureReader(" + typeName + "," + query.getFilter().getClass() + " " + query.getFilter() + ")"); - - FeatureReader reader = null; - if (query != null && query.getTypeName() != null) { - // use Filter to create optimized FeatureReader - Filter filter = query.getFilter(); - reader = getFeatureReader(typeName, filter); - } - - // default - if (reader == null) { - reader = super.getFeatureReader(typeName, query); - } - - return reader; - } - - /** - * Create an optimized FeatureReader for most of the uDig operations. - */ - protected FeatureReader getFeatureReader(String typeName, Filter filter) throws IOException { - Layer layer = spatialDatabase.getLayer(typeName); - - try (Transaction tx = database.beginTx()) { - Iterator records; - if (filter.equals(Filter.EXCLUDE)) { - // filter that excludes everything: create an empty FeatureReader - records = null; - } else if (filter instanceof FidFilterImpl) { - // filter by Feature unique id - throw new UnsupportedOperationException("Unsupported use of FidFilterImpl in Neo4jSpatialDataStore"); - } else { - records = layer.getIndex().search(new SearchCQL(layer, filter)); - } - - tx.success(); - return new Neo4jSpatialFeatureReader(layer, getSchema(typeName), records); - } - } - - protected ResourceInfo getInfo(String typeName) { - return new DefaultResourceInfo(typeName, getCRS(typeName), getBounds(typeName)); - } - - /** - * Create a FeatureReader that returns all Feature in the given Layer - */ - protected FeatureReader getFeatureReader(String typeName) throws IOException { - System.out.println("getFeatureReader(" + typeName + ") SLOW QUERY :("); - return getFeatureReader(typeName, new SearchAll()); - } - - private FeatureReader getFeatureReader(String typeName, SearchFilter search) throws IOException { - try (Transaction tx = database.beginTx()) { - Layer layer = spatialDatabase.getLayer(typeName); - SearchRecords results = layer.getIndex().search(search); - tx.success(); - return new Neo4jSpatialFeatureReader(layer, getSchema(typeName), results); - } - } - - private ReferencedEnvelope convertEnvelopeToRefEnvelope(String typeName, Envelope bbox) { - return new ReferencedEnvelope(bbox, getCRS(typeName)); - } - - private CoordinateReferenceSystem getCRS(String typeName) { - CoordinateReferenceSystem result = crsIndex.get(typeName); - if (result == null) { - try (Transaction tx = database.beginTx()) { - Layer layer = spatialDatabase.getLayer(typeName); - result = layer.getCoordinateReferenceSystem(); - crsIndex.put(typeName, result); - tx.success(); } + tx.success(); } - - return result; + return notEmptyTypes; } - public Style getStyle(String typeName) { - Style result = styleIndex.get(typeName); - if (true || result == null) { - Layer layer = spatialDatabase.getLayer(typeName); - Object obj = layer.getStyle(); - if(obj instanceof Style) { - result = (Style)result; - } else if (obj instanceof File || obj instanceof String) { - StyleFactory styleFactory = new StyleFactoryImpl(); - SLDParser parser = new SLDParser(styleFactory); - try { - if(obj instanceof File) { - parser.setInput(new FileReader((File)obj)); - }else{ - parser.setInput(new StringReader(obj.toString())); - } - Style[] styles = parser.readXML(); - result = styles[0]; - } - catch (Exception e) { - System.err.println("Error loading style '"+obj+"': "+e.getMessage()); - e.printStackTrace(System.err); - } - } - styleIndex.put(typeName, result); - } - - return result; + @Override + protected ContentFeatureSource createFeatureSource(ContentEntry contentEntry) { + return new Neo4jSpatialFeatureSource(spatialDatabase, contentEntry, Query.ALL); } - private Integer getGeometryType(String typeName) { - try (Transaction tx = database.beginTx()) { - Layer layer = spatialDatabase.getLayer(typeName); - tx.success(); - return layer.getGeometryType(); - } + @Override + public void dispose() { + spatialDatabase.getDatabase().shutdown(); + super.dispose(); } - private EditableLayer getEditableLayer(String typeName) throws IOException { - Layer layer = spatialDatabase.getLayer(typeName); - if (layer == null) { - throw new IOException("Layer not found: " + typeName); - } - - if (!(layer instanceof EditableLayer)) { - throw new IOException("Cannot create a FeatureWriter on a read-only layer: " + layer); - } - - return (EditableLayer) layer; - } - - /** - * Try to create an optimized FeatureWriter for the given Filter. - */ - protected FeatureWriter createFeatureWriter(String typeName, Filter filter, org.geotools.data.Transaction transaction) throws IOException { - FeatureReader reader = getFeatureReader(typeName, filter); - if (reader == null) { - reader = getFeatureReader(typeName, new SearchAll()); - } - - return new Neo4jSpatialFeatureWriter(listenerManager, transaction, getEditableLayer(typeName), reader); - } - - protected FeatureWriter createFeatureWriter(String typeName, org.geotools.data.Transaction transaction) throws IOException { - return new Neo4jSpatialFeatureWriter(listenerManager, transaction, getEditableLayer(typeName), getFeatureReader(typeName, new SearchAll())); + public Transaction beginTx() { + return spatialDatabase.getDatabase().beginTx(); } - - - // Attributes - - private String[] typeNames; - private Map simpleFeatureTypeIndex = Collections.synchronizedMap(new HashMap()); - private Map crsIndex = Collections.synchronizedMap(new HashMap()); - private Map styleIndex = Collections.synchronizedMap(new HashMap()); - private Map boundsIndex = Collections.synchronizedMap(new HashMap()); - private Map featureSourceIndex = Collections.synchronizedMap(new HashMap()); - private GraphDatabaseService database; - private SpatialDatabaseService spatialDatabase; -} \ No newline at end of file +} diff --git a/src/main/java/org/geotools/data/neo4j/Neo4jSpatialFeatureSource.java b/src/main/java/org/geotools/data/neo4j/Neo4jSpatialFeatureSource.java new file mode 100644 index 000000000..caae5f6df --- /dev/null +++ b/src/main/java/org/geotools/data/neo4j/Neo4jSpatialFeatureSource.java @@ -0,0 +1,188 @@ +package org.geotools.data.neo4j; + +import org.geotools.data.FeatureReader; +import org.geotools.data.FeatureWriter; +import org.geotools.data.Query; +import org.geotools.data.store.ContentEntry; +import org.geotools.data.store.ContentFeatureStore; +import org.geotools.filter.FidFilterImpl; +import org.geotools.geometry.jts.ReferencedEnvelope; +import org.locationtech.jts.geom.Envelope; +import org.neo4j.gis.spatial.*; +import org.neo4j.gis.spatial.filter.SearchCQL; +import org.neo4j.gis.spatial.rtree.filter.SearchAll; +import org.neo4j.gis.spatial.rtree.filter.SearchFilter; +import org.neo4j.graphdb.Transaction; +import org.opengis.feature.simple.SimpleFeature; +import org.opengis.feature.simple.SimpleFeatureType; +import org.opengis.filter.Filter; +import org.opengis.referencing.crs.CoordinateReferenceSystem; + +import java.io.IOException; +import java.util.Iterator; + +public class Neo4jSpatialFeatureSource extends ContentFeatureStore { + private final SpatialDatabaseService spatialDatabaseService; + private ReferencedEnvelope allEnvelope; + private CoordinateReferenceSystem crs; + private static final SearchFilter SEARCH_ALL = new SearchAll(); + private static final ReferencedEnvelope NULL_ENVELOPE = new ReferencedEnvelope(); + + public Neo4jSpatialFeatureSource(SpatialDatabaseService spatialDatabaseService, ContentEntry entry, Query query) { + super(entry, query); + this.spatialDatabaseService = spatialDatabaseService; + } + + @Override + protected ReferencedEnvelope getBoundsInternal(Query query) { + final SearchFilter searchFilter = getSearchFilter(query); + if (SEARCH_ALL.equals(searchFilter)) { + return getAllEnvelope(); + } + if (SearchNone.EXCLUDE_SEARCH_FILTER.equals(searchFilter)) { + return NULL_ENVELOPE; + } + Layer layer = getLayer(); + if (layer == null) { + return NULL_ENVELOPE; + } + Envelope envelope = new Envelope(); + try (Transaction tx = spatialDatabaseService.getDatabase().beginTx()) { + Iterator records = layer.getIndex().search(searchFilter); + while (records.hasNext()) { + final SpatialDatabaseRecord record = records.next(); + if (record.getGeometry() != null) { + envelope.expandToInclude(record.getGeometry().getEnvelopeInternal()); + } + } + tx.success(); + } + return convertEnvelopeToRefEnvelope(envelope); + } + + private CoordinateReferenceSystem getCRS() { + if (crs == null) { + crs = getLayer().getCoordinateReferenceSystem(); + } + return crs; + } + + private ReferencedEnvelope convertEnvelopeToRefEnvelope(Envelope bbox) { + return new ReferencedEnvelope(bbox, getCRS()); + } + + private ReferencedEnvelope getAllEnvelope() { + if (allEnvelope == null) { + Layer layer = getLayer(); + if (layer != null) { + try (Transaction tx = spatialDatabaseService.getDatabase().beginTx()) { + Envelope bbox = Utilities.fromNeo4jToJts(layer.getIndex().getBoundingBox()); + allEnvelope = convertEnvelopeToRefEnvelope(bbox); + tx.success(); + } + } + } + return allEnvelope; + } + + @Override + protected int getCountInternal(Query query) { + SearchFilter filter = getSearchFilter(query); + if (SearchNone.EXCLUDE_SEARCH_FILTER.equals(filter)) { + return 0; + } + int count = -1; + Layer layer = getLayer(); + + try (Transaction tx = spatialDatabaseService.getDatabase().beginTx()) { + count = layer.getIndex().count(); + tx.success(); + } + return count; + } + + @Override + protected FeatureReader getReaderInternal(Query query) { + Layer layer = getLayer(); + SearchFilter filter = getSearchFilter(query); + if (SearchNone.EXCLUDE_SEARCH_FILTER.equals(filter)) { + return new Neo4jSpatialFeatureReader(layer, getSchema(), null); + } + + try (Transaction tx = spatialDatabaseService.getDatabase().beginTx()) { + Iterator records = layer.getIndex().search(filter); + tx.success(); + return new Neo4jSpatialFeatureReader(layer, getSchema(), records); + } + } + + private SearchFilter getSearchFilter(Query query) { + Filter filter = getFilter(query); + if (Filter.EXCLUDE.equals(filter)) { + return SearchNone.EXCLUDE_SEARCH_FILTER; + } + if (Filter.INCLUDE.equals(filter)) { + return SEARCH_ALL; + } + if (filter instanceof FidFilterImpl) { + // filter by Feature unique id + throw new UnsupportedOperationException("Unsupported use of FidFilterImpl in Neo4jSpatialDataStore"); + } + return new SearchCQL(getLayer(), filter); + } + + private Filter getFilter(Query query) { + Filter filter = null; + if (query != null) { + filter = query.getFilter(); + } + if (filter == null) { + filter = Filter.INCLUDE; + } + return filter; + } + + @Override + protected SimpleFeatureType buildFeatureType() { + SimpleFeatureType result; + + try (Transaction tx = spatialDatabaseService.getDatabase().beginTx()) { + Layer layer = getLayer(); + result = Neo4jFeatureBuilder.getTypeFromLayer(layer); + tx.success(); + } + return result; + } + + private Layer getLayer() { + return spatialDatabaseService.getLayer(entry.getName().getURI()); + } + + @Override + public Neo4jSpatialDataStore getDataStore() { + return (Neo4jSpatialDataStore) super.getDataStore(); + } + + @Override + protected FeatureWriter getWriterInternal(Query query, int i) throws IOException { + Filter filter = getFilter(query); + if (transaction == null) { + throw new NullPointerException("getFeatureWriter requires Transaction: did you mean to use Transaction.AUTO_COMMIT?"); + } + FeatureReader reader = getReader(filter); + return new Neo4jSpatialFeatureWriter(getEditableLayer(), reader); + } + + private EditableLayer getEditableLayer() throws IOException { + Layer layer = getLayer(); + if (layer == null) { + throw new IOException("Layer not found: " + entry.getName().getURI()); + } + + if (!(layer instanceof EditableLayer)) { + throw new IOException("Cannot create a FeatureWriter on a read-only layer: " + layer); + } + + return (EditableLayer) layer; + } +} diff --git a/src/main/java/org/geotools/data/neo4j/Neo4jSpatialFeatureWriter.java b/src/main/java/org/geotools/data/neo4j/Neo4jSpatialFeatureWriter.java index d89896032..874f88f32 100644 --- a/src/main/java/org/geotools/data/neo4j/Neo4jSpatialFeatureWriter.java +++ b/src/main/java/org/geotools/data/neo4j/Neo4jSpatialFeatureWriter.java @@ -1,199 +1,169 @@ /** * Copyright (c) 2010-2017 "Neo Technology," * Network Engine for Objects in Lund AB [http://neotechnology.com] - * * This file is part of Neo4j Spatial. - * * Neo4j is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package org.geotools.data.neo4j; -import java.io.IOException; -import java.util.logging.Logger; - -import org.geotools.data.FeatureListenerManager; import org.geotools.data.FeatureReader; import org.geotools.data.FeatureWriter; import org.geotools.feature.simple.SimpleFeatureBuilder; -import org.geotools.geometry.jts.ReferencedEnvelope; +import org.locationtech.jts.geom.Geometry; import org.neo4j.gis.spatial.EditableLayer; import org.neo4j.graphdb.Transaction; import org.opengis.feature.simple.SimpleFeature; import org.opengis.feature.simple.SimpleFeatureType; -import com.vividsolutions.jts.geom.Geometry; +import java.io.IOException; +import java.util.logging.Logger; /** * FeatureWriter implementation. Instances of this class are created by * Neo4jSpatialDataStore. - * + * * @author Davide Savazzi, Andreas Wilhelm */ public class Neo4jSpatialFeatureWriter implements - FeatureWriter { - - // current for FeatureWriter - private SimpleFeature live; - // copy of live returned to user - private SimpleFeature current; - - private FeatureListenerManager listener; - private org.geotools.data.Transaction transaction; - private SimpleFeatureType featureType; - private FeatureReader reader; - private EditableLayer layer; - private boolean closed; - - private static final Logger LOGGER = org.geotools.util.logging.Logging - .getLogger("org.neo4j.gis.spatial"); - - /** - * - * @param listener - * @param transaction - * @param layer - * @param reader - */ - protected Neo4jSpatialFeatureWriter(FeatureListenerManager listener, - org.geotools.data.Transaction transaction, EditableLayer layer, - FeatureReader reader) { - this.transaction = transaction; - this.listener = listener; - this.reader = reader; - this.layer = layer; - this.featureType = reader.getFeatureType(); - } - - /** - * - */ - public SimpleFeatureType getFeatureType() { - return featureType; - } - - /** - * - */ - public boolean hasNext() throws IOException { - if (closed) { - throw new IOException("Feature writer is closed"); - } - - return reader != null && reader.hasNext(); - } - - /** - * - */ - public SimpleFeature next() throws IOException { - if (closed) { - throw new IOException("FeatureWriter has been closed"); - } - - SimpleFeatureType featureType = getFeatureType(); - - if (hasNext()) { - live = reader.next(); - current = SimpleFeatureBuilder.copy(live); - LOGGER.finer("Calling next on writer"); - } else { - // new content - live = null; - current = SimpleFeatureBuilder.template(featureType, null); - } - - return current; - } - - /** - * - */ - public void remove() throws IOException { - if (closed) { - throw new IOException("FeatureWriter has been closed"); - } - - if (current == null) { - throw new IOException("No feature available to remove"); - } - - if (live != null) { - LOGGER.fine("Removing " + live); - - try (Transaction tx = layer.getSpatialDatabase().getDatabase().beginTx()) { - layer.delete(Long.parseLong(live.getID())); - tx.success(); - } - - listener.fireFeaturesRemoved(featureType.getTypeName(), - transaction, new ReferencedEnvelope(live.getBounds()), true); - } - - live = null; - current = null; - } - - /** - * - */ - public void write() throws IOException { - if (closed) { - throw new IOException("FeatureWriter has been closed"); - } - - if (current == null) { - throw new IOException("No feature available to write"); - } - - LOGGER.fine("Write called, live is " + live + " and cur is " + current); - - if (live != null) { - if (!live.equals(current)) { - LOGGER.fine("Updating " + current); - try (Transaction tx = layer.getSpatialDatabase().getDatabase().beginTx()) { - layer.update(Long.parseLong(current.getID()), - (Geometry) current.getDefaultGeometry()); - tx.success(); - } - - listener.fireFeaturesChanged(featureType.getTypeName(), - transaction, - new ReferencedEnvelope(current.getBounds()), true); - - } - } else { - LOGGER.fine("Inserting " + current); - try (Transaction tx = layer.getSpatialDatabase().getDatabase().beginTx()) { - layer.add((Geometry) current.getDefaultGeometry()); - tx.success(); - } - - listener.fireFeaturesAdded(featureType.getTypeName(), transaction, - new ReferencedEnvelope(current.getBounds()), true); - } - - live = null; - current = null; - } - - /** - * - */ - public void close() throws IOException { - if (reader != null) - reader.close(); - closed = true; - } - -} \ No newline at end of file + FeatureWriter { + // current for FeatureWriter + private SimpleFeature live; + // copy of live returned to user + private SimpleFeature current; + private SimpleFeatureType featureType; + private FeatureReader reader; + private EditableLayer layer; + private boolean closed; + private static final Logger LOGGER = org.geotools.util.logging.Logging + .getLogger("org.neo4j.gis.spatial"); + + /** + * @param layer + * @param reader + */ + protected Neo4jSpatialFeatureWriter(EditableLayer layer, + FeatureReader reader) { + this.reader = reader; + this.layer = layer; + this.featureType = reader.getFeatureType(); + } + + /** + * + */ + public SimpleFeatureType getFeatureType() { + return featureType; + } + + /** + * + */ + public boolean hasNext() throws IOException { + if (closed) { + throw new IOException("Feature writer is closed"); + } + return reader != null && reader.hasNext(); + } + + /** + * + */ + public SimpleFeature next() throws IOException { + if (closed) { + throw new IOException("FeatureWriter has been closed"); + } + + SimpleFeatureType featureType = getFeatureType(); + + if (hasNext()) { + live = reader.next(); + current = SimpleFeatureBuilder.copy(live); + LOGGER.finer("Calling next on writer"); + } else { + // new content + live = null; + current = SimpleFeatureBuilder.template(featureType, null); + } + + return current; + } + + /** + * + */ + public void remove() throws IOException { + if (closed) { + throw new IOException("FeatureWriter has been closed"); + } + + if (current == null) { + throw new IOException("No feature available to remove"); + } + + if (live != null) { + LOGGER.fine("Removing " + live); + + try (Transaction tx = layer.getSpatialDatabase().getDatabase().beginTx()) { + layer.delete(Long.parseLong(live.getID())); + tx.success(); + } + } + + live = null; + current = null; + } + + /** + * + */ + public void write() throws IOException { + if (closed) { + throw new IOException("FeatureWriter has been closed"); + } + + if (current == null) { + throw new IOException("No feature available to write"); + } + + LOGGER.fine("Write called, live is " + live + " and cur is " + current); + + if (live != null) { + if (!live.equals(current)) { + LOGGER.fine("Updating " + current); + try (Transaction tx = layer.getSpatialDatabase().getDatabase().beginTx()) { + layer.update(Long.parseLong(current.getID()), + (Geometry) current.getDefaultGeometry()); + tx.success(); + } + } + } else { + LOGGER.fine("Inserting " + current); + try (Transaction tx = layer.getSpatialDatabase().getDatabase().beginTx()) { + layer.add((Geometry) current.getDefaultGeometry()); + tx.success(); + } + } + + live = null; + current = null; + } + + /** + * + */ + public void close() throws IOException { + if (reader != null) { + reader.close(); + } + closed = true; + } +} diff --git a/src/main/java/org/geotools/data/neo4j/SearchNone.java b/src/main/java/org/geotools/data/neo4j/SearchNone.java new file mode 100644 index 000000000..9dede8e13 --- /dev/null +++ b/src/main/java/org/geotools/data/neo4j/SearchNone.java @@ -0,0 +1,19 @@ +package org.geotools.data.neo4j; + +import org.neo4j.gis.spatial.rtree.Envelope; +import org.neo4j.gis.spatial.rtree.filter.SearchFilter; +import org.neo4j.graphdb.Node; + +class SearchNone implements SearchFilter { + public static final SearchFilter EXCLUDE_SEARCH_FILTER = new SearchNone(); + + @Override + public boolean needsToVisit(Envelope envelope) { + return false; + } + + @Override + public boolean geometryMatches(Node geomNode) { + return false; + } +} diff --git a/src/main/java/org/geotools/data/neo4j/StyledImageExporter.java b/src/main/java/org/geotools/data/neo4j/StyledImageExporter.java index 665b1a169..c04de552f 100644 --- a/src/main/java/org/geotools/data/neo4j/StyledImageExporter.java +++ b/src/main/java/org/geotools/data/neo4j/StyledImageExporter.java @@ -53,10 +53,10 @@ import org.geotools.styling.PointSymbolizer; import org.geotools.styling.PolygonSymbolizer; import org.geotools.styling.Rule; -import org.geotools.styling.SLDParser; import org.geotools.styling.Stroke; import org.geotools.styling.Style; import org.geotools.styling.StyleFactory; +import org.geotools.xml.styling.SLDParser; import org.neo4j.gis.spatial.SpatialTopologyUtils; import org.neo4j.graphdb.GraphDatabaseService; import org.neo4j.graphdb.Transaction; @@ -66,13 +66,13 @@ import org.opengis.feature.type.FeatureType; import org.opengis.filter.FilterFactory; -import com.vividsolutions.jts.geom.LineString; -import com.vividsolutions.jts.geom.LinearRing; -import com.vividsolutions.jts.geom.MultiLineString; -import com.vividsolutions.jts.geom.MultiPoint; -import com.vividsolutions.jts.geom.MultiPolygon; -import com.vividsolutions.jts.geom.Point; -import com.vividsolutions.jts.geom.Polygon; +import org.locationtech.jts.geom.LineString; +import org.locationtech.jts.geom.LinearRing; +import org.locationtech.jts.geom.MultiLineString; +import org.locationtech.jts.geom.MultiPoint; +import org.locationtech.jts.geom.MultiPolygon; +import org.locationtech.jts.geom.Point; +import org.locationtech.jts.geom.Polygon; public class StyledImageExporter { private GraphDatabaseService db; @@ -460,4 +460,4 @@ public static void main(String[] args) { db.shutdown(); } } -} \ No newline at end of file +} diff --git a/src/main/java/org/neo4j/gis/spatial/AbstractGeometryEncoder.java b/src/main/java/org/neo4j/gis/spatial/AbstractGeometryEncoder.java index d7f7ab03f..f937777ed 100644 --- a/src/main/java/org/neo4j/gis/spatial/AbstractGeometryEncoder.java +++ b/src/main/java/org/neo4j/gis/spatial/AbstractGeometryEncoder.java @@ -24,7 +24,7 @@ import org.neo4j.graphdb.Node; import org.neo4j.graphdb.PropertyContainer; -import com.vividsolutions.jts.geom.Geometry; +import org.locationtech.jts.geom.Geometry; /** @@ -139,4 +139,4 @@ public String getSignature() { // Attributes protected Layer layer; -} \ No newline at end of file +} diff --git a/src/main/java/org/neo4j/gis/spatial/DefaultLayer.java b/src/main/java/org/neo4j/gis/spatial/DefaultLayer.java index cd1d43564..cec58c7c3 100644 --- a/src/main/java/org/neo4j/gis/spatial/DefaultLayer.java +++ b/src/main/java/org/neo4j/gis/spatial/DefaultLayer.java @@ -21,8 +21,8 @@ import java.util.*; -import com.vividsolutions.jts.geom.PrecisionModel; -import org.geotools.factory.FactoryRegistryException; +import org.geotools.util.factory.FactoryRegistryException; +import org.locationtech.jts.geom.PrecisionModel; import org.geotools.referencing.CRS; import org.geotools.referencing.ReferencingFactoryFinder; import org.neo4j.gis.spatial.index.LayerIndexReader; @@ -40,8 +40,8 @@ import org.opengis.referencing.FactoryException; import org.opengis.referencing.crs.CoordinateReferenceSystem; -import com.vividsolutions.jts.geom.Geometry; -import com.vividsolutions.jts.geom.GeometryFactory; +import org.locationtech.jts.geom.Geometry; +import org.locationtech.jts.geom.GeometryFactory; /** * Instances of Layer provide the ability for developers to add/remove and edit diff --git a/src/main/java/org/neo4j/gis/spatial/DynamicLayerConfig.java b/src/main/java/org/neo4j/gis/spatial/DynamicLayerConfig.java index 25a1a9c3d..adb0ff1b1 100644 --- a/src/main/java/org/neo4j/gis/spatial/DynamicLayerConfig.java +++ b/src/main/java/org/neo4j/gis/spatial/DynamicLayerConfig.java @@ -39,7 +39,7 @@ import org.neo4j.graphdb.Transaction; import org.opengis.referencing.crs.CoordinateReferenceSystem; -import com.vividsolutions.jts.geom.GeometryFactory; +import org.locationtech.jts.geom.GeometryFactory; public class DynamicLayerConfig implements Layer, Constants { diff --git a/src/main/java/org/neo4j/gis/spatial/EditableLayer.java b/src/main/java/org/neo4j/gis/spatial/EditableLayer.java index 0c078efb6..6efca30e1 100644 --- a/src/main/java/org/neo4j/gis/spatial/EditableLayer.java +++ b/src/main/java/org/neo4j/gis/spatial/EditableLayer.java @@ -21,7 +21,7 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem; -import com.vividsolutions.jts.geom.Geometry; +import org.locationtech.jts.geom.Geometry; /** * Instances of Layer provide the ability for developers to add/remove and edit geometries diff --git a/src/main/java/org/neo4j/gis/spatial/EditableLayerImpl.java b/src/main/java/org/neo4j/gis/spatial/EditableLayerImpl.java index b59c5f3d3..42cc4b5aa 100644 --- a/src/main/java/org/neo4j/gis/spatial/EditableLayerImpl.java +++ b/src/main/java/org/neo4j/gis/spatial/EditableLayerImpl.java @@ -22,7 +22,7 @@ import org.neo4j.graphdb.Node; import org.neo4j.graphdb.Transaction; -import com.vividsolutions.jts.geom.Geometry; +import org.locationtech.jts.geom.Geometry; public class EditableLayerImpl extends DefaultLayer implements EditableLayer { diff --git a/src/main/java/org/neo4j/gis/spatial/GeometryEncoder.java b/src/main/java/org/neo4j/gis/spatial/GeometryEncoder.java index bdc5cbd9d..4302ee9f3 100644 --- a/src/main/java/org/neo4j/gis/spatial/GeometryEncoder.java +++ b/src/main/java/org/neo4j/gis/spatial/GeometryEncoder.java @@ -23,7 +23,7 @@ import org.neo4j.graphdb.Node; import org.neo4j.graphdb.PropertyContainer; -import com.vividsolutions.jts.geom.Geometry; +import org.locationtech.jts.geom.Geometry; /** @@ -118,4 +118,4 @@ public interface GeometryEncoder extends EnvelopeDecoder { * @return descriptive signature of encoder, type and configuration */ String getSignature(); -} \ No newline at end of file +} diff --git a/src/main/java/org/neo4j/gis/spatial/Layer.java b/src/main/java/org/neo4j/gis/spatial/Layer.java index 2f23c8b6b..5d83d135f 100644 --- a/src/main/java/org/neo4j/gis/spatial/Layer.java +++ b/src/main/java/org/neo4j/gis/spatial/Layer.java @@ -25,7 +25,7 @@ import org.neo4j.graphdb.Node; import org.opengis.referencing.crs.CoordinateReferenceSystem; -import com.vividsolutions.jts.geom.GeometryFactory; +import org.locationtech.jts.geom.GeometryFactory; import java.util.List; diff --git a/src/main/java/org/neo4j/gis/spatial/LineStringNetworkGenerator.java b/src/main/java/org/neo4j/gis/spatial/LineStringNetworkGenerator.java index e6e13b60a..e20b65442 100644 --- a/src/main/java/org/neo4j/gis/spatial/LineStringNetworkGenerator.java +++ b/src/main/java/org/neo4j/gis/spatial/LineStringNetworkGenerator.java @@ -24,9 +24,9 @@ import org.neo4j.gis.spatial.filter.SearchIntersect; import org.neo4j.graphdb.Node; -import com.vividsolutions.jts.geom.Geometry; -import com.vividsolutions.jts.geom.LineString; -import com.vividsolutions.jts.geom.MultiLineString; +import org.locationtech.jts.geom.Geometry; +import org.locationtech.jts.geom.LineString; +import org.locationtech.jts.geom.MultiLineString; /** @@ -113,4 +113,4 @@ protected void addEdgePoint(Node edge, Geometry edgePoint) { private EditableLayer pointsLayer; private EditableLayer edgesLayer; private Double buffer; -} \ No newline at end of file +} diff --git a/src/main/java/org/neo4j/gis/spatial/OrderedEditableLayer.java b/src/main/java/org/neo4j/gis/spatial/OrderedEditableLayer.java index fa873a2e9..112538e9b 100644 --- a/src/main/java/org/neo4j/gis/spatial/OrderedEditableLayer.java +++ b/src/main/java/org/neo4j/gis/spatial/OrderedEditableLayer.java @@ -28,7 +28,7 @@ import org.neo4j.graphdb.traversal.Evaluators; import org.neo4j.graphdb.traversal.TraversalDescription; -import com.vividsolutions.jts.geom.Geometry; +import org.locationtech.jts.geom.Geometry; /** * This class extends the EditableLayerImpl in a way that allows for the diff --git a/src/main/java/org/neo4j/gis/spatial/ShapefileImporter.java b/src/main/java/org/neo4j/gis/spatial/ShapefileImporter.java index c778964b3..fda5c97cf 100644 --- a/src/main/java/org/neo4j/gis/spatial/ShapefileImporter.java +++ b/src/main/java/org/neo4j/gis/spatial/ShapefileImporter.java @@ -44,9 +44,9 @@ import org.opengis.referencing.FactoryException; import org.opengis.referencing.crs.CoordinateReferenceSystem; -import com.vividsolutions.jts.geom.Envelope; -import com.vividsolutions.jts.geom.Geometry; -import com.vividsolutions.jts.geom.GeometryFactory; +import org.locationtech.jts.geom.Envelope; +import org.locationtech.jts.geom.Geometry; +import org.locationtech.jts.geom.GeometryFactory; /** diff --git a/src/main/java/org/neo4j/gis/spatial/SimplePointLayer.java b/src/main/java/org/neo4j/gis/spatial/SimplePointLayer.java index 63efabe7b..964675bd9 100644 --- a/src/main/java/org/neo4j/gis/spatial/SimplePointLayer.java +++ b/src/main/java/org/neo4j/gis/spatial/SimplePointLayer.java @@ -24,7 +24,7 @@ import org.neo4j.gis.spatial.pipes.GeoPipeFlow; import org.neo4j.gis.spatial.pipes.GeoPipeline; -import com.vividsolutions.jts.geom.Coordinate; +import org.locationtech.jts.geom.Coordinate; import org.neo4j.gis.spatial.pipes.processing.OrthodromicDistance; public class SimplePointLayer extends EditableLayerImpl { diff --git a/src/main/java/org/neo4j/gis/spatial/SpatialDatabaseRecord.java b/src/main/java/org/neo4j/gis/spatial/SpatialDatabaseRecord.java index 852592d3a..14ba4b7f0 100644 --- a/src/main/java/org/neo4j/gis/spatial/SpatialDatabaseRecord.java +++ b/src/main/java/org/neo4j/gis/spatial/SpatialDatabaseRecord.java @@ -26,7 +26,7 @@ import org.neo4j.graphdb.Node; import org.opengis.referencing.crs.CoordinateReferenceSystem; -import com.vividsolutions.jts.geom.Geometry; +import org.locationtech.jts.geom.Geometry; public class SpatialDatabaseRecord implements Constants, SpatialRecord { @@ -189,4 +189,4 @@ private String getPropString() { private Node geomNode; private Geometry geometry; private Layer layer; -} \ No newline at end of file +} diff --git a/src/main/java/org/neo4j/gis/spatial/SpatialDatabaseService.java b/src/main/java/org/neo4j/gis/spatial/SpatialDatabaseService.java index ec2cecb1a..fd5f57a11 100644 --- a/src/main/java/org/neo4j/gis/spatial/SpatialDatabaseService.java +++ b/src/main/java/org/neo4j/gis/spatial/SpatialDatabaseService.java @@ -19,7 +19,7 @@ */ package org.neo4j.gis.spatial; -import com.vividsolutions.jts.geom.*; +import org.locationtech.jts.geom.*; import org.geotools.referencing.crs.AbstractCRS; import org.geotools.referencing.crs.DefaultGeographicCRS; import org.neo4j.gis.spatial.encoders.Configurable; @@ -381,7 +381,7 @@ public GraphDatabaseService getDatabase() { public static int convertGeometryNameToType(String geometryName) { if(geometryName == null) return GTYPE_GEOMETRY; try { - return convertJtsClassToGeometryType((Class) Class.forName("com.vividsolutions.jts.geom." + return convertJtsClassToGeometryType((Class) Class.forName("org.locationtech.jts.geom." + geometryName)); } catch (ClassNotFoundException e) { System.err.println("Unrecognized geometry '" + geometryName + "': " + e); @@ -390,7 +390,7 @@ public static int convertGeometryNameToType(String geometryName) { } public static String convertGeometryTypeToName(Integer geometryType) { - return convertGeometryTypeToJtsClass(geometryType).getName().replace("com.vividsolutions.jts.geom.", ""); + return convertGeometryTypeToJtsClass(geometryType).getName().replace("org.locationtech.jts.geom.", ""); } public static Class convertGeometryTypeToJtsClass(Integer geometryType) { diff --git a/src/main/java/org/neo4j/gis/spatial/SpatialDataset.java b/src/main/java/org/neo4j/gis/spatial/SpatialDataset.java index a9df4e413..d5cb875e2 100644 --- a/src/main/java/org/neo4j/gis/spatial/SpatialDataset.java +++ b/src/main/java/org/neo4j/gis/spatial/SpatialDataset.java @@ -21,7 +21,7 @@ import org.neo4j.graphdb.Node; -import com.vividsolutions.jts.geom.Geometry; +import org.locationtech.jts.geom.Geometry; /** *

diff --git a/src/main/java/org/neo4j/gis/spatial/SpatialRecord.java b/src/main/java/org/neo4j/gis/spatial/SpatialRecord.java index 67a549df9..f6e5391b8 100644 --- a/src/main/java/org/neo4j/gis/spatial/SpatialRecord.java +++ b/src/main/java/org/neo4j/gis/spatial/SpatialRecord.java @@ -21,7 +21,7 @@ import java.util.Map; -import com.vividsolutions.jts.geom.Geometry; +import org.locationtech.jts.geom.Geometry; import org.neo4j.graphdb.Node; public interface SpatialRecord { diff --git a/src/main/java/org/neo4j/gis/spatial/SpatialTopologyUtils.java b/src/main/java/org/neo4j/gis/spatial/SpatialTopologyUtils.java index 9244c6d77..c7cbe2ac2 100644 --- a/src/main/java/org/neo4j/gis/spatial/SpatialTopologyUtils.java +++ b/src/main/java/org/neo4j/gis/spatial/SpatialTopologyUtils.java @@ -24,15 +24,15 @@ import org.geotools.geometry.jts.ReferencedEnvelope; import org.neo4j.gis.spatial.filter.SearchIntersect; -import com.vividsolutions.jts.geom.Coordinate; -import com.vividsolutions.jts.geom.Envelope; -import com.vividsolutions.jts.geom.Geometry; -import com.vividsolutions.jts.geom.GeometryFactory; -import com.vividsolutions.jts.geom.LineString; -import com.vividsolutions.jts.geom.Point; -import com.vividsolutions.jts.linearref.LengthIndexedLine; -import com.vividsolutions.jts.linearref.LinearLocation; -import com.vividsolutions.jts.linearref.LocationIndexedLine; +import org.locationtech.jts.geom.Coordinate; +import org.locationtech.jts.geom.Envelope; +import org.locationtech.jts.geom.Geometry; +import org.locationtech.jts.geom.GeometryFactory; +import org.locationtech.jts.geom.LineString; +import org.locationtech.jts.geom.Point; +import org.locationtech.jts.linearref.LengthIndexedLine; +import org.locationtech.jts.linearref.LinearLocation; +import org.locationtech.jts.linearref.LocationIndexedLine; /** diff --git a/src/main/java/org/neo4j/gis/spatial/Utilities.java b/src/main/java/org/neo4j/gis/spatial/Utilities.java index ae2058edf..b3f71d77b 100644 --- a/src/main/java/org/neo4j/gis/spatial/Utilities.java +++ b/src/main/java/org/neo4j/gis/spatial/Utilities.java @@ -38,11 +38,11 @@ import org.neo4j.graphdb.Node; import org.opengis.filter.Filter; -import com.vividsolutions.jts.geom.Geometry; +import org.locationtech.jts.geom.Geometry; public class Utilities { - public static Envelope fromJtsToNeo4j(com.vividsolutions.jts.geom.Envelope envelope) { + public static Envelope fromJtsToNeo4j(org.locationtech.jts.geom.Envelope envelope) { return new Envelope( envelope.getMinX(), envelope.getMaxX(), @@ -51,8 +51,8 @@ public static Envelope fromJtsToNeo4j(com.vividsolutions.jts.geom.Envelope envel ); } - public static com.vividsolutions.jts.geom.Envelope fromNeo4jToJts(org.neo4j.gis.spatial.index.Envelope envelope) { - return new com.vividsolutions.jts.geom.Envelope( + public static org.locationtech.jts.geom.Envelope fromNeo4jToJts(org.neo4j.gis.spatial.index.Envelope envelope) { + return new org.locationtech.jts.geom.Envelope( envelope.getMinX(), envelope.getMaxX(), envelope.getMinY(), diff --git a/src/main/java/org/neo4j/gis/spatial/WKBGeometryEncoder.java b/src/main/java/org/neo4j/gis/spatial/WKBGeometryEncoder.java index 2bcfcf98a..9bac09a14 100644 --- a/src/main/java/org/neo4j/gis/spatial/WKBGeometryEncoder.java +++ b/src/main/java/org/neo4j/gis/spatial/WKBGeometryEncoder.java @@ -23,10 +23,10 @@ import org.neo4j.gis.spatial.encoders.Configurable; import org.neo4j.graphdb.PropertyContainer; -import com.vividsolutions.jts.geom.Geometry; -import com.vividsolutions.jts.io.ParseException; -import com.vividsolutions.jts.io.WKBReader; -import com.vividsolutions.jts.io.WKBWriter; +import org.locationtech.jts.geom.Geometry; +import org.locationtech.jts.io.ParseException; +import org.locationtech.jts.io.WKBReader; +import org.locationtech.jts.io.WKBWriter; /** * @author Davide Savazzi @@ -55,4 +55,4 @@ protected void encodeGeometryShape(Geometry geometry, PropertyContainer containe public String getSignature() { return "WKB" + super.getSignature(); } -} \ No newline at end of file +} diff --git a/src/main/java/org/neo4j/gis/spatial/WKTGeometryEncoder.java b/src/main/java/org/neo4j/gis/spatial/WKTGeometryEncoder.java index f29fae0de..1ff6f3568 100644 --- a/src/main/java/org/neo4j/gis/spatial/WKTGeometryEncoder.java +++ b/src/main/java/org/neo4j/gis/spatial/WKTGeometryEncoder.java @@ -23,10 +23,10 @@ import org.neo4j.gis.spatial.encoders.Configurable; import org.neo4j.graphdb.PropertyContainer; -import com.vividsolutions.jts.geom.Geometry; -import com.vividsolutions.jts.io.ParseException; -import com.vividsolutions.jts.io.WKTReader; -import com.vividsolutions.jts.io.WKTWriter; +import org.locationtech.jts.geom.Geometry; +import org.locationtech.jts.io.ParseException; +import org.locationtech.jts.io.WKTReader; +import org.locationtech.jts.io.WKTWriter; /** * @author Davide Savazzi @@ -55,4 +55,4 @@ protected void encodeGeometryShape(Geometry geometry, PropertyContainer containe public String getSignature() { return "WKT" + super.getSignature(); } -} \ No newline at end of file +} diff --git a/src/main/java/org/neo4j/gis/spatial/encoders/NativePointEncoder.java b/src/main/java/org/neo4j/gis/spatial/encoders/NativePointEncoder.java index a77019d5d..4c888562a 100644 --- a/src/main/java/org/neo4j/gis/spatial/encoders/NativePointEncoder.java +++ b/src/main/java/org/neo4j/gis/spatial/encoders/NativePointEncoder.java @@ -19,10 +19,10 @@ */ package org.neo4j.gis.spatial.encoders; -import com.vividsolutions.jts.geom.Coordinate; -import com.vividsolutions.jts.geom.Geometry; -import com.vividsolutions.jts.geom.GeometryFactory; -import com.vividsolutions.jts.geom.Point; +import org.locationtech.jts.geom.Coordinate; +import org.locationtech.jts.geom.Geometry; +import org.locationtech.jts.geom.GeometryFactory; +import org.locationtech.jts.geom.Point; import org.neo4j.gis.spatial.AbstractGeometryEncoder; import org.neo4j.gis.spatial.SpatialDatabaseService; import org.neo4j.gis.spatial.encoders.neo4j.Neo4jCRS; @@ -92,4 +92,4 @@ public void setConfiguration(String configuration) { public String getSignature() { return "NativePointEncoder(geometry='" + locationProperty + "', bbox='" + bboxProperty + "', crs=" + crs.getCode() + ")"; } -} \ No newline at end of file +} diff --git a/src/main/java/org/neo4j/gis/spatial/encoders/SimpleGraphEncoder.java b/src/main/java/org/neo4j/gis/spatial/encoders/SimpleGraphEncoder.java index 48799334b..cab63f724 100644 --- a/src/main/java/org/neo4j/gis/spatial/encoders/SimpleGraphEncoder.java +++ b/src/main/java/org/neo4j/gis/spatial/encoders/SimpleGraphEncoder.java @@ -28,10 +28,10 @@ import org.neo4j.graphdb.traversal.Evaluators; import org.neo4j.graphdb.traversal.TraversalDescription; -import com.vividsolutions.jts.geom.Coordinate; -import com.vividsolutions.jts.geom.CoordinateList; -import com.vividsolutions.jts.geom.Geometry; -import com.vividsolutions.jts.geom.GeometryFactory; +import org.locationtech.jts.geom.Coordinate; +import org.locationtech.jts.geom.CoordinateList; +import org.locationtech.jts.geom.Geometry; +import org.locationtech.jts.geom.GeometryFactory; /** * Simple encoder that stores geometries as an linked list of point @@ -90,4 +90,4 @@ public Geometry decodeGeometry(PropertyContainer container) { } return getGeometryFactory().createLineString(coordinates.toCoordinateArray()); } -} \ No newline at end of file +} diff --git a/src/main/java/org/neo4j/gis/spatial/encoders/SimplePointEncoder.java b/src/main/java/org/neo4j/gis/spatial/encoders/SimplePointEncoder.java index 44cffaaa5..b244e9ba2 100644 --- a/src/main/java/org/neo4j/gis/spatial/encoders/SimplePointEncoder.java +++ b/src/main/java/org/neo4j/gis/spatial/encoders/SimplePointEncoder.java @@ -23,9 +23,9 @@ import org.neo4j.gis.spatial.SpatialDatabaseService; import org.neo4j.graphdb.PropertyContainer; -import com.vividsolutions.jts.geom.Coordinate; -import com.vividsolutions.jts.geom.Geometry; -import com.vividsolutions.jts.geom.GeometryFactory; +import org.locationtech.jts.geom.Coordinate; +import org.locationtech.jts.geom.Geometry; +import org.locationtech.jts.geom.GeometryFactory; /** * Simple encoder that stores point geometries as two x/y properties. diff --git a/src/main/java/org/neo4j/gis/spatial/encoders/SimplePropertyEncoder.java b/src/main/java/org/neo4j/gis/spatial/encoders/SimplePropertyEncoder.java index 3f259a08b..1ea33895b 100644 --- a/src/main/java/org/neo4j/gis/spatial/encoders/SimplePropertyEncoder.java +++ b/src/main/java/org/neo4j/gis/spatial/encoders/SimplePropertyEncoder.java @@ -23,9 +23,9 @@ import org.neo4j.gis.spatial.SpatialDatabaseService; import org.neo4j.graphdb.PropertyContainer; -import com.vividsolutions.jts.geom.Coordinate; -import com.vividsolutions.jts.geom.Geometry; -import com.vividsolutions.jts.geom.GeometryFactory; +import org.locationtech.jts.geom.Coordinate; +import org.locationtech.jts.geom.Geometry; +import org.locationtech.jts.geom.GeometryFactory; /** * Simple encoder that stores geometries as an array of float values. @@ -65,4 +65,4 @@ public Geometry decodeGeometry(PropertyContainer container) { } return getGeometryFactory().createLineString(coordinates); } -} \ No newline at end of file +} diff --git a/src/main/java/org/neo4j/gis/spatial/encoders/neo4j/Neo4jPoint.java b/src/main/java/org/neo4j/gis/spatial/encoders/neo4j/Neo4jPoint.java index 3e8893013..e550cd094 100644 --- a/src/main/java/org/neo4j/gis/spatial/encoders/neo4j/Neo4jPoint.java +++ b/src/main/java/org/neo4j/gis/spatial/encoders/neo4j/Neo4jPoint.java @@ -1,7 +1,7 @@ package org.neo4j.gis.spatial.encoders.neo4j; -import com.vividsolutions.jts.geom.Coordinate; -import com.vividsolutions.jts.geom.Point; +import org.locationtech.jts.geom.Coordinate; +import org.locationtech.jts.geom.Point; import java.util.ArrayList; diff --git a/src/main/java/org/neo4j/gis/spatial/filter/AbstractSearchIntersection.java b/src/main/java/org/neo4j/gis/spatial/filter/AbstractSearchIntersection.java index 27b527d8d..ee176f3a0 100644 --- a/src/main/java/org/neo4j/gis/spatial/filter/AbstractSearchIntersection.java +++ b/src/main/java/org/neo4j/gis/spatial/filter/AbstractSearchIntersection.java @@ -24,7 +24,7 @@ import org.neo4j.gis.spatial.Utilities; import org.neo4j.graphdb.Node; -import com.vividsolutions.jts.geom.Geometry; +import org.locationtech.jts.geom.Geometry; /** * @author Craig Taverner @@ -44,4 +44,4 @@ protected Geometry decode(Node geomNode) { return layer.getGeometryEncoder().decodeGeometry(geomNode); } -} \ No newline at end of file +} diff --git a/src/main/java/org/neo4j/gis/spatial/filter/SearchIntersect.java b/src/main/java/org/neo4j/gis/spatial/filter/SearchIntersect.java index 3ca9e5b1a..17e299c63 100644 --- a/src/main/java/org/neo4j/gis/spatial/filter/SearchIntersect.java +++ b/src/main/java/org/neo4j/gis/spatial/filter/SearchIntersect.java @@ -23,7 +23,7 @@ import org.neo4j.gis.spatial.Layer; import org.neo4j.graphdb.Node; -import com.vividsolutions.jts.geom.Geometry; +import org.locationtech.jts.geom.Geometry; /** @@ -43,4 +43,4 @@ protected boolean onEnvelopeIntersection(Node geomNode, Envelope geomEnvelope) { return geometry.intersects(referenceGeometry); } -} \ No newline at end of file +} diff --git a/src/main/java/org/neo4j/gis/spatial/filter/SearchIntersectWindow.java b/src/main/java/org/neo4j/gis/spatial/filter/SearchIntersectWindow.java index 9daa39f89..1d5ff6319 100644 --- a/src/main/java/org/neo4j/gis/spatial/filter/SearchIntersectWindow.java +++ b/src/main/java/org/neo4j/gis/spatial/filter/SearchIntersectWindow.java @@ -25,7 +25,7 @@ import org.neo4j.gis.spatial.Utilities; import org.neo4j.graphdb.Node; -import com.vividsolutions.jts.geom.Geometry; +import org.locationtech.jts.geom.Geometry; /** * Find geometries that intersect with the specified search window. @@ -41,7 +41,7 @@ public SearchIntersectWindow(Layer layer, Envelope envelope) { this(layer, Utilities.fromNeo4jToJts(envelope)); } - public SearchIntersectWindow(Layer layer, com.vividsolutions.jts.geom.Envelope other) { + public SearchIntersectWindow(Layer layer, org.locationtech.jts.geom.Envelope other) { super(layer.getGeometryEncoder(), Utilities.fromJtsToNeo4j(other)); this.layer = layer; this.windowGeom = layer.getGeometryFactory().toGeometry(other); @@ -56,4 +56,4 @@ protected boolean onEnvelopeIntersection(Node geomNode, org.neo4j.gis.spatial.rt return geometry.intersects(windowGeom); } -} \ No newline at end of file +} diff --git a/src/main/java/org/neo4j/gis/spatial/index/LayerGeohashPointIndex.java b/src/main/java/org/neo4j/gis/spatial/index/LayerGeohashPointIndex.java index 62bf80e9d..8a007e7f8 100644 --- a/src/main/java/org/neo4j/gis/spatial/index/LayerGeohashPointIndex.java +++ b/src/main/java/org/neo4j/gis/spatial/index/LayerGeohashPointIndex.java @@ -19,8 +19,8 @@ */ package org.neo4j.gis.spatial.index; -import com.vividsolutions.jts.geom.Geometry; -import com.vividsolutions.jts.geom.Point; +import org.locationtech.jts.geom.Geometry; +import org.locationtech.jts.geom.Point; import org.apache.lucene.spatial.util.GeoHashUtils; import org.neo4j.gis.spatial.rtree.Envelope; import org.neo4j.gis.spatial.rtree.filter.AbstractSearchEnvelopeIntersection; diff --git a/src/main/java/org/neo4j/gis/spatial/index/LayerSpaceFillingCurvePointIndex.java b/src/main/java/org/neo4j/gis/spatial/index/LayerSpaceFillingCurvePointIndex.java index 515ef87c8..d2e2718f8 100644 --- a/src/main/java/org/neo4j/gis/spatial/index/LayerSpaceFillingCurvePointIndex.java +++ b/src/main/java/org/neo4j/gis/spatial/index/LayerSpaceFillingCurvePointIndex.java @@ -19,8 +19,8 @@ */ package org.neo4j.gis.spatial.index; -import com.vividsolutions.jts.geom.Geometry; -import com.vividsolutions.jts.geom.Point; +import org.locationtech.jts.geom.Geometry; +import org.locationtech.jts.geom.Point; import org.neo4j.gis.spatial.index.curves.SpaceFillingCurve; import org.neo4j.gis.spatial.index.curves.StandardConfiguration; import org.neo4j.gis.spatial.rtree.filter.AbstractSearchEnvelopeIntersection; diff --git a/src/main/java/org/neo4j/gis/spatial/osm/OSMDataset.java b/src/main/java/org/neo4j/gis/spatial/osm/OSMDataset.java index 903b1d926..0a78bead1 100644 --- a/src/main/java/org/neo4j/gis/spatial/osm/OSMDataset.java +++ b/src/main/java/org/neo4j/gis/spatial/osm/OSMDataset.java @@ -36,9 +36,9 @@ import org.neo4j.graphdb.traversal.Evaluators; import org.neo4j.graphdb.traversal.TraversalDescription; -import com.vividsolutions.jts.geom.Coordinate; -import com.vividsolutions.jts.geom.Envelope; -import com.vividsolutions.jts.geom.Geometry; +import org.locationtech.jts.geom.Coordinate; +import org.locationtech.jts.geom.Envelope; +import org.locationtech.jts.geom.Geometry; public class OSMDataset implements SpatialDataset, Iterable, Iterator { private OSMLayer layer; diff --git a/src/main/java/org/neo4j/gis/spatial/osm/OSMGeometryEncoder.java b/src/main/java/org/neo4j/gis/spatial/osm/OSMGeometryEncoder.java index f561c4855..446b5e480 100644 --- a/src/main/java/org/neo4j/gis/spatial/osm/OSMGeometryEncoder.java +++ b/src/main/java/org/neo4j/gis/spatial/osm/OSMGeometryEncoder.java @@ -40,13 +40,13 @@ import org.neo4j.graphdb.Relationship; import org.neo4j.graphdb.traversal.TraversalDescription; -import com.vividsolutions.jts.algorithm.ConvexHull; -import com.vividsolutions.jts.geom.Coordinate; -import com.vividsolutions.jts.geom.Geometry; -import com.vividsolutions.jts.geom.GeometryFactory; -import com.vividsolutions.jts.geom.LineString; -import com.vividsolutions.jts.geom.LinearRing; -import com.vividsolutions.jts.geom.Polygon; +import org.locationtech.jts.algorithm.ConvexHull; +import org.locationtech.jts.geom.Coordinate; +import org.locationtech.jts.geom.Geometry; +import org.locationtech.jts.geom.GeometryFactory; +import org.locationtech.jts.geom.LineString; +import org.locationtech.jts.geom.LinearRing; +import org.locationtech.jts.geom.Polygon; public class OSMGeometryEncoder extends AbstractGeometryEncoder { diff --git a/src/main/java/org/neo4j/gis/spatial/osm/OSMImporter.java b/src/main/java/org/neo4j/gis/spatial/osm/OSMImporter.java index f5ca88b04..4099455b5 100644 --- a/src/main/java/org/neo4j/gis/spatial/osm/OSMImporter.java +++ b/src/main/java/org/neo4j/gis/spatial/osm/OSMImporter.java @@ -68,7 +68,7 @@ public class OSMImporter implements Constants private long osm_dataset = -1; private long missingChangesets = 0; private Listener monitor; - private com.vividsolutions.jts.geom.Envelope filterEnvelope = null; + private org.locationtech.jts.geom.Envelope filterEnvelope = null; private Charset charset = Charset.defaultCharset(); @@ -208,7 +208,7 @@ public OSMImporter( String layerName, Listener monitor ) this( layerName, null, null ); } - public OSMImporter( String layerName, Listener monitor, com.vividsolutions.jts.geom.Envelope filterEnvelope ) + public OSMImporter( String layerName, Listener monitor, org.locationtech.jts.geom.Envelope filterEnvelope ) { this.layerName = layerName; if ( monitor == null ) monitor = new NullListener(); diff --git a/src/main/java/org/neo4j/gis/spatial/pipes/AbstractGeoPipe.java b/src/main/java/org/neo4j/gis/spatial/pipes/AbstractGeoPipe.java index 98fdb2ccd..fe5ae7674 100644 --- a/src/main/java/org/neo4j/gis/spatial/pipes/AbstractGeoPipe.java +++ b/src/main/java/org/neo4j/gis/spatial/pipes/AbstractGeoPipe.java @@ -21,7 +21,7 @@ import java.util.NoSuchElementException; -import com.vividsolutions.jts.geom.Geometry; +import org.locationtech.jts.geom.Geometry; import org.neo4j.gis.spatial.pipes.impl.AbstractPipe; /** diff --git a/src/main/java/org/neo4j/gis/spatial/pipes/GeoPipeFlow.java b/src/main/java/org/neo4j/gis/spatial/pipes/GeoPipeFlow.java index 4dd430892..5c6dd8764 100644 --- a/src/main/java/org/neo4j/gis/spatial/pipes/GeoPipeFlow.java +++ b/src/main/java/org/neo4j/gis/spatial/pipes/GeoPipeFlow.java @@ -27,8 +27,8 @@ import org.neo4j.gis.spatial.SpatialDatabaseRecord; import org.neo4j.gis.spatial.SpatialRecord; -import com.vividsolutions.jts.geom.Envelope; -import com.vividsolutions.jts.geom.Geometry; +import org.locationtech.jts.geom.Envelope; +import org.locationtech.jts.geom.Geometry; import org.neo4j.graphdb.Node; diff --git a/src/main/java/org/neo4j/gis/spatial/pipes/GeoPipeline.java b/src/main/java/org/neo4j/gis/spatial/pipes/GeoPipeline.java index 194b613e5..6dd734ce0 100644 --- a/src/main/java/org/neo4j/gis/spatial/pipes/GeoPipeline.java +++ b/src/main/java/org/neo4j/gis/spatial/pipes/GeoPipeline.java @@ -104,10 +104,10 @@ import org.opengis.feature.simple.SimpleFeature; import org.opengis.feature.simple.SimpleFeatureType; -import com.vividsolutions.jts.geom.Coordinate; -import com.vividsolutions.jts.geom.Envelope; -import com.vividsolutions.jts.geom.Geometry; -import com.vividsolutions.jts.geom.util.AffineTransformation; +import org.locationtech.jts.geom.Coordinate; +import org.locationtech.jts.geom.Envelope; +import org.locationtech.jts.geom.Geometry; +import org.locationtech.jts.geom.util.AffineTransformation; public class GeoPipeline extends Pipeline { @@ -1022,4 +1022,4 @@ public GeoPipeline add(final Pipe pipe) { public GeoPipeline range(final int low, final int high) { return this.add(new RangeFilterPipe(low, high)); } -} \ No newline at end of file +} diff --git a/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterContain.java b/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterContain.java index ab1bee167..459b4801b 100644 --- a/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterContain.java +++ b/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterContain.java @@ -22,8 +22,8 @@ import org.neo4j.gis.spatial.pipes.AbstractFilterGeoPipe; import org.neo4j.gis.spatial.pipes.GeoPipeFlow; -import com.vividsolutions.jts.geom.Envelope; -import com.vividsolutions.jts.geom.Geometry; +import org.locationtech.jts.geom.Envelope; +import org.locationtech.jts.geom.Geometry; /** diff --git a/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterCover.java b/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterCover.java index d003af3a3..a556083e7 100644 --- a/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterCover.java +++ b/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterCover.java @@ -22,8 +22,8 @@ import org.neo4j.gis.spatial.pipes.AbstractFilterGeoPipe; import org.neo4j.gis.spatial.pipes.GeoPipeFlow; -import com.vividsolutions.jts.geom.Envelope; -import com.vividsolutions.jts.geom.Geometry; +import org.locationtech.jts.geom.Envelope; +import org.locationtech.jts.geom.Geometry; /** diff --git a/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterCoveredBy.java b/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterCoveredBy.java index 126ce8f9b..bdc20394c 100644 --- a/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterCoveredBy.java +++ b/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterCoveredBy.java @@ -22,8 +22,8 @@ import org.neo4j.gis.spatial.pipes.AbstractFilterGeoPipe; import org.neo4j.gis.spatial.pipes.GeoPipeFlow; -import com.vividsolutions.jts.geom.Envelope; -import com.vividsolutions.jts.geom.Geometry; +import org.locationtech.jts.geom.Envelope; +import org.locationtech.jts.geom.Geometry; /** @@ -46,4 +46,4 @@ protected boolean validate(GeoPipeFlow flow) { && flow.getGeometry().coveredBy(other); } -} \ No newline at end of file +} diff --git a/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterCross.java b/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterCross.java index ae8e91094..1a21d2226 100644 --- a/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterCross.java +++ b/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterCross.java @@ -22,7 +22,7 @@ import org.neo4j.gis.spatial.pipes.AbstractFilterGeoPipe; import org.neo4j.gis.spatial.pipes.GeoPipeFlow; -import com.vividsolutions.jts.geom.Geometry; +import org.locationtech.jts.geom.Geometry; /** @@ -40,4 +40,4 @@ public FilterCross(Geometry other) { protected boolean validate(GeoPipeFlow flow) { return flow.getGeometry().crosses(other); } -} \ No newline at end of file +} diff --git a/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterDisjoint.java b/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterDisjoint.java index 808c61bf6..0204398d4 100644 --- a/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterDisjoint.java +++ b/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterDisjoint.java @@ -22,8 +22,8 @@ import org.neo4j.gis.spatial.pipes.AbstractFilterGeoPipe; import org.neo4j.gis.spatial.pipes.GeoPipeFlow; -import com.vividsolutions.jts.geom.Envelope; -import com.vividsolutions.jts.geom.Geometry; +import org.locationtech.jts.geom.Envelope; +import org.locationtech.jts.geom.Geometry; /** @@ -44,4 +44,4 @@ protected boolean validate(GeoPipeFlow flow) { return !flow.getEnvelope().intersects(otherEnvelope) || flow.getGeometry().disjoint(other); } -} \ No newline at end of file +} diff --git a/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterEqualExact.java b/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterEqualExact.java index 10fbe5465..012e8ddba 100644 --- a/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterEqualExact.java +++ b/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterEqualExact.java @@ -22,7 +22,7 @@ import org.neo4j.gis.spatial.pipes.AbstractFilterGeoPipe; import org.neo4j.gis.spatial.pipes.GeoPipeFlow; -import com.vividsolutions.jts.geom.Geometry; +import org.locationtech.jts.geom.Geometry; /** diff --git a/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterEqualNorm.java b/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterEqualNorm.java index 8742094c7..ed9300656 100644 --- a/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterEqualNorm.java +++ b/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterEqualNorm.java @@ -22,7 +22,7 @@ import org.neo4j.gis.spatial.pipes.AbstractFilterGeoPipe; import org.neo4j.gis.spatial.pipes.GeoPipeFlow; -import com.vividsolutions.jts.geom.Geometry; +import org.locationtech.jts.geom.Geometry; /** diff --git a/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterEqualTopo.java b/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterEqualTopo.java index 93a64c25b..068c60cf2 100644 --- a/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterEqualTopo.java +++ b/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterEqualTopo.java @@ -22,7 +22,7 @@ import org.neo4j.gis.spatial.pipes.AbstractFilterGeoPipe; import org.neo4j.gis.spatial.pipes.GeoPipeFlow; -import com.vividsolutions.jts.geom.Geometry; +import org.locationtech.jts.geom.Geometry; /** diff --git a/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterInRelation.java b/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterInRelation.java index 5ae9fb52e..b4454f47a 100644 --- a/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterInRelation.java +++ b/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterInRelation.java @@ -22,7 +22,7 @@ import org.neo4j.gis.spatial.pipes.AbstractFilterGeoPipe; import org.neo4j.gis.spatial.pipes.GeoPipeFlow; -import com.vividsolutions.jts.geom.Geometry; +import org.locationtech.jts.geom.Geometry; /** diff --git a/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterIntersect.java b/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterIntersect.java index 5b489562c..d9ee6839e 100644 --- a/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterIntersect.java +++ b/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterIntersect.java @@ -22,7 +22,7 @@ import org.neo4j.gis.spatial.pipes.AbstractFilterGeoPipe; import org.neo4j.gis.spatial.pipes.GeoPipeFlow; -import com.vividsolutions.jts.geom.Geometry; +import org.locationtech.jts.geom.Geometry; /** @@ -40,4 +40,4 @@ public FilterIntersect(Geometry geometry) { protected boolean validate(GeoPipeFlow flow) { return geometry.intersects(flow.getGeometry()); } -} \ No newline at end of file +} diff --git a/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterIntersectWindow.java b/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterIntersectWindow.java index c1941b0d4..365c8c56d 100644 --- a/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterIntersectWindow.java +++ b/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterIntersectWindow.java @@ -22,9 +22,9 @@ import org.neo4j.gis.spatial.pipes.AbstractFilterGeoPipe; import org.neo4j.gis.spatial.pipes.GeoPipeFlow; -import com.vividsolutions.jts.geom.Envelope; -import com.vividsolutions.jts.geom.Geometry; -import com.vividsolutions.jts.geom.GeometryFactory; +import org.locationtech.jts.geom.Envelope; +import org.locationtech.jts.geom.Geometry; +import org.locationtech.jts.geom.GeometryFactory; /** @@ -49,4 +49,4 @@ protected boolean validate(GeoPipeFlow flow) { return envelope.intersects(flow.getEnvelope()) && envelopeGeom.intersects(flow.getGeometry()); } -} \ No newline at end of file +} diff --git a/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterOverlap.java b/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterOverlap.java index e596015c4..81dbb7976 100644 --- a/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterOverlap.java +++ b/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterOverlap.java @@ -22,7 +22,7 @@ import org.neo4j.gis.spatial.pipes.AbstractFilterGeoPipe; import org.neo4j.gis.spatial.pipes.GeoPipeFlow; -import com.vividsolutions.jts.geom.Geometry; +import org.locationtech.jts.geom.Geometry; /** @@ -44,4 +44,4 @@ protected boolean validate(GeoPipeFlow flow) { // the same dimension as the geometries themselves return flow.getGeometry().overlaps(other); } -} \ No newline at end of file +} diff --git a/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterTouch.java b/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterTouch.java index 15db90812..6c18c9cd7 100644 --- a/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterTouch.java +++ b/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterTouch.java @@ -22,7 +22,7 @@ import org.neo4j.gis.spatial.pipes.AbstractFilterGeoPipe; import org.neo4j.gis.spatial.pipes.GeoPipeFlow; -import com.vividsolutions.jts.geom.Geometry; +import org.locationtech.jts.geom.Geometry; /** @@ -41,4 +41,4 @@ protected boolean validate(GeoPipeFlow flow) { // if the geometries have at least one point in common, but their interiors do not intersect return flow.getGeometry().touches(other); } -} \ No newline at end of file +} diff --git a/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterWithin.java b/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterWithin.java index b869352f8..f5c7a6ab8 100644 --- a/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterWithin.java +++ b/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterWithin.java @@ -22,8 +22,8 @@ import org.neo4j.gis.spatial.pipes.AbstractFilterGeoPipe; import org.neo4j.gis.spatial.pipes.GeoPipeFlow; -import com.vividsolutions.jts.geom.Envelope; -import com.vividsolutions.jts.geom.Geometry; +import org.locationtech.jts.geom.Envelope; +import org.locationtech.jts.geom.Geometry; /** @@ -46,4 +46,4 @@ protected boolean validate(GeoPipeFlow flow) { return otherEnvelope.contains(flow.getEnvelope()) && flow.getGeometry().within(other); } -} \ No newline at end of file +} diff --git a/src/main/java/org/neo4j/gis/spatial/pipes/osm/processing/ExtractOSMPoints.java b/src/main/java/org/neo4j/gis/spatial/pipes/osm/processing/ExtractOSMPoints.java index 6a65fc8e8..c52a946c6 100644 --- a/src/main/java/org/neo4j/gis/spatial/pipes/osm/processing/ExtractOSMPoints.java +++ b/src/main/java/org/neo4j/gis/spatial/pipes/osm/processing/ExtractOSMPoints.java @@ -31,8 +31,8 @@ import org.neo4j.graphdb.traversal.TraversalDescription; import org.neo4j.graphdb.traversal.Uniqueness; -import com.vividsolutions.jts.geom.Coordinate; -import com.vividsolutions.jts.geom.GeometryFactory; +import org.locationtech.jts.geom.Coordinate; +import org.locationtech.jts.geom.GeometryFactory; public class ExtractOSMPoints extends AbstractExtractGeoPipe { diff --git a/src/main/java/org/neo4j/gis/spatial/pipes/processing/ApplyAffineTransformation.java b/src/main/java/org/neo4j/gis/spatial/pipes/processing/ApplyAffineTransformation.java index 0ba8c32ea..89cb3f766 100644 --- a/src/main/java/org/neo4j/gis/spatial/pipes/processing/ApplyAffineTransformation.java +++ b/src/main/java/org/neo4j/gis/spatial/pipes/processing/ApplyAffineTransformation.java @@ -22,7 +22,7 @@ import org.neo4j.gis.spatial.pipes.AbstractGeoPipe; import org.neo4j.gis.spatial.pipes.GeoPipeFlow; -import com.vividsolutions.jts.geom.util.AffineTransformation; +import org.locationtech.jts.geom.util.AffineTransformation; /** * Applies an Affine Transformation to every geometry. diff --git a/src/main/java/org/neo4j/gis/spatial/pipes/processing/Densify.java b/src/main/java/org/neo4j/gis/spatial/pipes/processing/Densify.java index 0a23a8592..93b56ee35 100644 --- a/src/main/java/org/neo4j/gis/spatial/pipes/processing/Densify.java +++ b/src/main/java/org/neo4j/gis/spatial/pipes/processing/Densify.java @@ -22,7 +22,7 @@ import org.neo4j.gis.spatial.pipes.AbstractGeoPipe; import org.neo4j.gis.spatial.pipes.GeoPipeFlow; -import com.vividsolutions.jts.densify.Densifier; +import org.locationtech.jts.densify.Densifier; /** * Densify geometries by inserting extra vertices along the line segments in the geometry. @@ -55,4 +55,4 @@ protected GeoPipeFlow process(GeoPipeFlow flow) { return flow; } -} \ No newline at end of file +} diff --git a/src/main/java/org/neo4j/gis/spatial/pipes/processing/Difference.java b/src/main/java/org/neo4j/gis/spatial/pipes/processing/Difference.java index 9612a2614..dc4c6ac61 100644 --- a/src/main/java/org/neo4j/gis/spatial/pipes/processing/Difference.java +++ b/src/main/java/org/neo4j/gis/spatial/pipes/processing/Difference.java @@ -22,7 +22,7 @@ import org.neo4j.gis.spatial.pipes.AbstractGeoPipe; import org.neo4j.gis.spatial.pipes.GeoPipeFlow; -import com.vividsolutions.jts.geom.Geometry; +import org.locationtech.jts.geom.Geometry; /** * Computes a geometry representing the points making up item geometry that do not make up the given geometry. @@ -50,4 +50,4 @@ protected GeoPipeFlow process(GeoPipeFlow flow) { setGeometry(flow, flow.getGeometry().difference(other)); return flow; } -} \ No newline at end of file +} diff --git a/src/main/java/org/neo4j/gis/spatial/pipes/processing/Distance.java b/src/main/java/org/neo4j/gis/spatial/pipes/processing/Distance.java index f415bc66d..f34cf4f4c 100644 --- a/src/main/java/org/neo4j/gis/spatial/pipes/processing/Distance.java +++ b/src/main/java/org/neo4j/gis/spatial/pipes/processing/Distance.java @@ -22,7 +22,7 @@ import org.neo4j.gis.spatial.pipes.AbstractGeoPipe; import org.neo4j.gis.spatial.pipes.GeoPipeFlow; -import com.vividsolutions.jts.geom.Geometry; +import org.locationtech.jts.geom.Geometry; /** @@ -50,4 +50,4 @@ protected GeoPipeFlow process(GeoPipeFlow flow) { return flow; } -} \ No newline at end of file +} diff --git a/src/main/java/org/neo4j/gis/spatial/pipes/processing/EndPoint.java b/src/main/java/org/neo4j/gis/spatial/pipes/processing/EndPoint.java index 4dc09a7e3..be0912edc 100644 --- a/src/main/java/org/neo4j/gis/spatial/pipes/processing/EndPoint.java +++ b/src/main/java/org/neo4j/gis/spatial/pipes/processing/EndPoint.java @@ -22,8 +22,8 @@ import org.neo4j.gis.spatial.pipes.AbstractGeoPipe; import org.neo4j.gis.spatial.pipes.GeoPipeFlow; -import com.vividsolutions.jts.geom.Coordinate; -import com.vividsolutions.jts.geom.GeometryFactory; +import org.locationtech.jts.geom.Coordinate; +import org.locationtech.jts.geom.GeometryFactory; /** * Find the ending point of item geometry. @@ -52,4 +52,4 @@ protected GeoPipeFlow process(GeoPipeFlow flow) { return flow; } -} \ No newline at end of file +} diff --git a/src/main/java/org/neo4j/gis/spatial/pipes/processing/ExtractPoints.java b/src/main/java/org/neo4j/gis/spatial/pipes/processing/ExtractPoints.java index f96f861ad..a2f58a0a1 100644 --- a/src/main/java/org/neo4j/gis/spatial/pipes/processing/ExtractPoints.java +++ b/src/main/java/org/neo4j/gis/spatial/pipes/processing/ExtractPoints.java @@ -22,7 +22,7 @@ import org.neo4j.gis.spatial.pipes.AbstractExtractGeoPipe; import org.neo4j.gis.spatial.pipes.GeoPipeFlow; -import com.vividsolutions.jts.geom.GeometryFactory; +import org.locationtech.jts.geom.GeometryFactory; /** * Extracts every point from a geometry. diff --git a/src/main/java/org/neo4j/gis/spatial/pipes/processing/GML.java b/src/main/java/org/neo4j/gis/spatial/pipes/processing/GML.java index 2c1554927..a3c90007e 100644 --- a/src/main/java/org/neo4j/gis/spatial/pipes/processing/GML.java +++ b/src/main/java/org/neo4j/gis/spatial/pipes/processing/GML.java @@ -22,7 +22,7 @@ import org.neo4j.gis.spatial.pipes.AbstractGeoPipe; import org.neo4j.gis.spatial.pipes.GeoPipeFlow; -import com.vividsolutions.jts.io.gml2.GMLWriter; +import org.locationtech.jts.io.gml2.GMLWriter; /** @@ -47,4 +47,4 @@ protected GeoPipeFlow process(GeoPipeFlow flow) { return flow; } -} \ No newline at end of file +} diff --git a/src/main/java/org/neo4j/gis/spatial/pipes/processing/Intersection.java b/src/main/java/org/neo4j/gis/spatial/pipes/processing/Intersection.java index ae99b9565..5a4fc1b36 100644 --- a/src/main/java/org/neo4j/gis/spatial/pipes/processing/Intersection.java +++ b/src/main/java/org/neo4j/gis/spatial/pipes/processing/Intersection.java @@ -22,7 +22,7 @@ import org.neo4j.gis.spatial.pipes.AbstractGeoPipe; import org.neo4j.gis.spatial.pipes.GeoPipeFlow; -import com.vividsolutions.jts.geom.Geometry; +import org.locationtech.jts.geom.Geometry; /** * Computes a geometry representing the intersection between item geometry and the given geometry. @@ -49,4 +49,4 @@ protected GeoPipeFlow process(GeoPipeFlow flow) { setGeometry(flow, flow.getGeometry().intersection(other)); return flow; } -} \ No newline at end of file +} diff --git a/src/main/java/org/neo4j/gis/spatial/pipes/processing/KeyholeMarkupLanguage.java b/src/main/java/org/neo4j/gis/spatial/pipes/processing/KeyholeMarkupLanguage.java index 2b15724c9..8271ac52d 100644 --- a/src/main/java/org/neo4j/gis/spatial/pipes/processing/KeyholeMarkupLanguage.java +++ b/src/main/java/org/neo4j/gis/spatial/pipes/processing/KeyholeMarkupLanguage.java @@ -23,7 +23,7 @@ import org.geotools.kml.KML; import org.geotools.kml.KMLConfiguration; -import org.geotools.xml.Encoder; +import org.geotools.xsd.Encoder; import org.neo4j.gis.spatial.pipes.AbstractGeoPipe; import org.neo4j.gis.spatial.pipes.GeoPipeFlow; @@ -54,4 +54,4 @@ protected GeoPipeFlow process(GeoPipeFlow flow) { return flow; } -} \ No newline at end of file +} diff --git a/src/main/java/org/neo4j/gis/spatial/pipes/processing/OrthodromicDistance.java b/src/main/java/org/neo4j/gis/spatial/pipes/processing/OrthodromicDistance.java index 24619fa7f..252671a32 100644 --- a/src/main/java/org/neo4j/gis/spatial/pipes/processing/OrthodromicDistance.java +++ b/src/main/java/org/neo4j/gis/spatial/pipes/processing/OrthodromicDistance.java @@ -19,14 +19,14 @@ */ package org.neo4j.gis.spatial.pipes.processing; -import com.vividsolutions.jts.geom.Geometry; -import com.vividsolutions.jts.geom.Point; -import com.vividsolutions.jts.operation.distance.DistanceOp; +import org.locationtech.jts.geom.Geometry; +import org.locationtech.jts.geom.Point; +import org.locationtech.jts.operation.distance.DistanceOp; import org.neo4j.gis.spatial.pipes.AbstractGeoPipe; import org.neo4j.gis.spatial.pipes.GeoPipeFlow; -import com.vividsolutions.jts.geom.Coordinate; -import com.vividsolutions.jts.geom.Envelope; +import org.locationtech.jts.geom.Coordinate; +import org.locationtech.jts.geom.Envelope; /** @@ -96,4 +96,4 @@ public static double calculateDistance(Coordinate reference, Coordinate point) { * earthRadiusInKm; return distanceInKm; } -} \ No newline at end of file +} diff --git a/src/main/java/org/neo4j/gis/spatial/pipes/processing/OrthodromicLength.java b/src/main/java/org/neo4j/gis/spatial/pipes/processing/OrthodromicLength.java index 7202cf8e1..5fbf85720 100644 --- a/src/main/java/org/neo4j/gis/spatial/pipes/processing/OrthodromicLength.java +++ b/src/main/java/org/neo4j/gis/spatial/pipes/processing/OrthodromicLength.java @@ -24,8 +24,8 @@ import org.neo4j.gis.spatial.pipes.GeoPipeFlow; import org.opengis.referencing.crs.CoordinateReferenceSystem; -import com.vividsolutions.jts.geom.Coordinate; -import com.vividsolutions.jts.geom.Geometry; +import org.locationtech.jts.geom.Coordinate; +import org.locationtech.jts.geom.Geometry; /** @@ -73,4 +73,4 @@ protected double calculateLength(Geometry geometry, CoordinateReferenceSystem cr return totalLength; } -} \ No newline at end of file +} diff --git a/src/main/java/org/neo4j/gis/spatial/pipes/processing/SimplifyPreservingTopology.java b/src/main/java/org/neo4j/gis/spatial/pipes/processing/SimplifyPreservingTopology.java index 9494ff3b3..4eb571d2c 100644 --- a/src/main/java/org/neo4j/gis/spatial/pipes/processing/SimplifyPreservingTopology.java +++ b/src/main/java/org/neo4j/gis/spatial/pipes/processing/SimplifyPreservingTopology.java @@ -22,7 +22,7 @@ import org.neo4j.gis.spatial.pipes.AbstractGeoPipe; import org.neo4j.gis.spatial.pipes.GeoPipeFlow; -import com.vividsolutions.jts.simplify.TopologyPreservingSimplifier; +import org.locationtech.jts.simplify.TopologyPreservingSimplifier; /** * Simplifies geometry for every item in the pipeline, using an algorithm that preserves geometry topology. diff --git a/src/main/java/org/neo4j/gis/spatial/pipes/processing/SimplifyWithDouglasPeucker.java b/src/main/java/org/neo4j/gis/spatial/pipes/processing/SimplifyWithDouglasPeucker.java index ddc81deb1..ec0eab8f1 100644 --- a/src/main/java/org/neo4j/gis/spatial/pipes/processing/SimplifyWithDouglasPeucker.java +++ b/src/main/java/org/neo4j/gis/spatial/pipes/processing/SimplifyWithDouglasPeucker.java @@ -22,7 +22,7 @@ import org.neo4j.gis.spatial.pipes.AbstractGeoPipe; import org.neo4j.gis.spatial.pipes.GeoPipeFlow; -import com.vividsolutions.jts.simplify.DouglasPeuckerSimplifier; +import org.locationtech.jts.simplify.DouglasPeuckerSimplifier; /** diff --git a/src/main/java/org/neo4j/gis/spatial/pipes/processing/StartPoint.java b/src/main/java/org/neo4j/gis/spatial/pipes/processing/StartPoint.java index ff89e6d96..e31e7bee9 100644 --- a/src/main/java/org/neo4j/gis/spatial/pipes/processing/StartPoint.java +++ b/src/main/java/org/neo4j/gis/spatial/pipes/processing/StartPoint.java @@ -22,7 +22,7 @@ import org.neo4j.gis.spatial.pipes.AbstractGeoPipe; import org.neo4j.gis.spatial.pipes.GeoPipeFlow; -import com.vividsolutions.jts.geom.GeometryFactory; +import org.locationtech.jts.geom.GeometryFactory; /** * Find the starting point of item geometry. @@ -50,4 +50,4 @@ protected GeoPipeFlow process(GeoPipeFlow flow) { return flow; } -} \ No newline at end of file +} diff --git a/src/main/java/org/neo4j/gis/spatial/pipes/processing/SymDifference.java b/src/main/java/org/neo4j/gis/spatial/pipes/processing/SymDifference.java index 0d62bb440..2f4034275 100644 --- a/src/main/java/org/neo4j/gis/spatial/pipes/processing/SymDifference.java +++ b/src/main/java/org/neo4j/gis/spatial/pipes/processing/SymDifference.java @@ -22,7 +22,7 @@ import org.neo4j.gis.spatial.pipes.AbstractGeoPipe; import org.neo4j.gis.spatial.pipes.GeoPipeFlow; -import com.vividsolutions.jts.geom.Geometry; +import org.locationtech.jts.geom.Geometry; /** * Computes the symmetric difference of the given geometry with item geometry. @@ -49,4 +49,4 @@ protected GeoPipeFlow process(GeoPipeFlow flow) { setGeometry(flow, flow.getGeometry().symDifference(other)); return flow; } -} \ No newline at end of file +} diff --git a/src/main/java/org/neo4j/gis/spatial/pipes/processing/Union.java b/src/main/java/org/neo4j/gis/spatial/pipes/processing/Union.java index c5eafe833..42c1dae85 100644 --- a/src/main/java/org/neo4j/gis/spatial/pipes/processing/Union.java +++ b/src/main/java/org/neo4j/gis/spatial/pipes/processing/Union.java @@ -22,7 +22,7 @@ import org.neo4j.gis.spatial.pipes.AbstractGeoPipe; import org.neo4j.gis.spatial.pipes.GeoPipeFlow; -import com.vividsolutions.jts.geom.Geometry; +import org.locationtech.jts.geom.Geometry; /** * Unites item geometry with itself or with the given geometry. @@ -60,4 +60,4 @@ protected GeoPipeFlow process(GeoPipeFlow flow) { } return flow; } -} \ No newline at end of file +} diff --git a/src/main/java/org/neo4j/gis/spatial/pipes/processing/WellKnownText.java b/src/main/java/org/neo4j/gis/spatial/pipes/processing/WellKnownText.java index 5ee454a63..96b3fe0ca 100644 --- a/src/main/java/org/neo4j/gis/spatial/pipes/processing/WellKnownText.java +++ b/src/main/java/org/neo4j/gis/spatial/pipes/processing/WellKnownText.java @@ -22,7 +22,7 @@ import org.neo4j.gis.spatial.pipes.AbstractGeoPipe; import org.neo4j.gis.spatial.pipes.GeoPipeFlow; -import com.vividsolutions.jts.io.WKTWriter; +import org.locationtech.jts.io.WKTWriter; /** * Encodes item geometry to Well Known Text (WKT). @@ -46,4 +46,4 @@ protected GeoPipeFlow process(GeoPipeFlow flow) { return flow; } -} \ No newline at end of file +} diff --git a/src/main/java/org/neo4j/gis/spatial/procedures/SpatialProcedures.java b/src/main/java/org/neo4j/gis/spatial/procedures/SpatialProcedures.java index c098b8026..1c2a6e7a5 100644 --- a/src/main/java/org/neo4j/gis/spatial/procedures/SpatialProcedures.java +++ b/src/main/java/org/neo4j/gis/spatial/procedures/SpatialProcedures.java @@ -19,9 +19,9 @@ */ package org.neo4j.gis.spatial.procedures; -import com.vividsolutions.jts.geom.*; -import com.vividsolutions.jts.io.ParseException; -import com.vividsolutions.jts.io.WKTReader; +import org.locationtech.jts.geom.*; +import org.locationtech.jts.io.ParseException; +import org.locationtech.jts.io.WKTReader; import org.geotools.referencing.crs.DefaultGeographicCRS; import org.neo4j.gis.spatial.*; import org.neo4j.gis.spatial.encoders.NativePointEncoder; diff --git a/src/main/java/org/neo4j/gis/spatial/process/SpatialProcess.java b/src/main/java/org/neo4j/gis/spatial/process/SpatialProcess.java index a0801ee05..2b7221cf2 100644 --- a/src/main/java/org/neo4j/gis/spatial/process/SpatialProcess.java +++ b/src/main/java/org/neo4j/gis/spatial/process/SpatialProcess.java @@ -25,8 +25,8 @@ import org.geotools.process.factory.StaticMethodsProcessFactory; import org.geotools.text.Text; -import com.vividsolutions.jts.geom.Geometry; -import com.vividsolutions.jts.geom.OctagonalEnvelope; +import org.locationtech.jts.geom.Geometry; +import org.locationtech.jts.geom.OctagonalEnvelope; public class SpatialProcess extends StaticMethodsProcessFactory { diff --git a/src/main/java/org/neo4j/gis/spatial/rtree/RTreeImageExporter.java b/src/main/java/org/neo4j/gis/spatial/rtree/RTreeImageExporter.java index 949ceafb3..0d056f0c0 100644 --- a/src/main/java/org/neo4j/gis/spatial/rtree/RTreeImageExporter.java +++ b/src/main/java/org/neo4j/gis/spatial/rtree/RTreeImageExporter.java @@ -19,9 +19,9 @@ */ package org.neo4j.gis.spatial.rtree; -import com.vividsolutions.jts.geom.Coordinate; -import com.vividsolutions.jts.geom.Geometry; -import com.vividsolutions.jts.geom.GeometryFactory; +import org.locationtech.jts.geom.Coordinate; +import org.locationtech.jts.geom.Geometry; +import org.locationtech.jts.geom.GeometryFactory; import org.geotools.data.memory.MemoryFeatureCollection; import org.geotools.data.neo4j.Neo4jFeatureBuilder; import org.geotools.data.neo4j.StyledImageExporter; @@ -60,7 +60,7 @@ public class RTreeImageExporter { public RTreeImageExporter(Layer layer, RTreeIndex index, Coordinate min, Coordinate max) { initialize(layer.getGeometryFactory(), layer.getGeometryEncoder(), layer.getCoordinateReferenceSystem(), Neo4jFeatureBuilder.getTypeFromLayer(layer), index); - bounds.expandToInclude(new com.vividsolutions.jts.geom.Envelope(min.x, max.x, min.y, max.y)); + bounds.expandToInclude(new org.locationtech.jts.geom.Envelope(min.x, max.x, min.y, max.y)); bounds = SpatialTopologyUtils.adjustBounds(bounds, 1.0 / zoom, offset); } @@ -71,7 +71,7 @@ public RTreeImageExporter(Layer layer, RTreeIndex index) { public RTreeImageExporter(GeometryFactory geometryFactory, GeometryEncoder geometryEncoder, CoordinateReferenceSystem crs, SimpleFeatureType featureType, RTreeIndex index, Coordinate min, Coordinate max) { initialize(geometryFactory, geometryEncoder, crs, featureType, index); - bounds.expandToInclude(new com.vividsolutions.jts.geom.Envelope(min.x, max.x, min.y, max.y)); + bounds.expandToInclude(new org.locationtech.jts.geom.Envelope(min.x, max.x, min.y, max.y)); bounds = SpatialTopologyUtils.adjustBounds(bounds, 1.0 / zoom, offset); } diff --git a/src/main/java/org/neo4j/gis/spatial/server/plugin/SpatialPlugin.java b/src/main/java/org/neo4j/gis/spatial/server/plugin/SpatialPlugin.java index 47d51d3fd..748f7b88a 100644 --- a/src/main/java/org/neo4j/gis/spatial/server/plugin/SpatialPlugin.java +++ b/src/main/java/org/neo4j/gis/spatial/server/plugin/SpatialPlugin.java @@ -19,9 +19,9 @@ */ package org.neo4j.gis.spatial.server.plugin; -import com.vividsolutions.jts.geom.*; -import com.vividsolutions.jts.io.ParseException; -import com.vividsolutions.jts.io.WKTReader; +import org.locationtech.jts.geom.*; +import org.locationtech.jts.io.ParseException; +import org.locationtech.jts.io.WKTReader; import org.neo4j.gis.spatial.*; import org.neo4j.gis.spatial.pipes.GeoPipeline; import org.neo4j.gis.spatial.pipes.processing.OrthodromicDistance; diff --git a/src/test/java/org/neo4j/gis/spatial/LayersTest.java b/src/test/java/org/neo4j/gis/spatial/LayersTest.java index 867477e99..bdcd4fb57 100644 --- a/src/test/java/org/neo4j/gis/spatial/LayersTest.java +++ b/src/test/java/org/neo4j/gis/spatial/LayersTest.java @@ -19,10 +19,10 @@ */ package org.neo4j.gis.spatial; -import com.vividsolutions.jts.geom.Coordinate; -import com.vividsolutions.jts.geom.CoordinateList; -import com.vividsolutions.jts.geom.Envelope; -import com.vividsolutions.jts.geom.LineString; +import org.locationtech.jts.geom.Coordinate; +import org.locationtech.jts.geom.CoordinateList; +import org.locationtech.jts.geom.Envelope; +import org.locationtech.jts.geom.LineString; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -295,7 +295,7 @@ public void testShapefileExport() throws Exception { tx.success(); } catch (Exception e) { if (e.getMessage().contains( - "com.vividsolutions.jts.geom.Geometry")) { + " org.locationtech.jts.geom.Geometry")) { osmExportException = e; } else { throw e; diff --git a/src/test/java/org/neo4j/gis/spatial/Neo4jSpatialDataStoreTest.java b/src/test/java/org/neo4j/gis/spatial/Neo4jSpatialDataStoreTest.java index 10bb512ea..af9f93967 100644 --- a/src/test/java/org/neo4j/gis/spatial/Neo4jSpatialDataStoreTest.java +++ b/src/test/java/org/neo4j/gis/spatial/Neo4jSpatialDataStoreTest.java @@ -50,21 +50,20 @@ public void teardown() { } @Test - public void shouldOpenDataStore() { + public void shouldOpenDataStore() throws IOException { Neo4jSpatialDataStore store = new Neo4jSpatialDataStore(graph); - ReferencedEnvelope bounds = store.getBounds("map"); + ReferencedEnvelope bounds = store.getFeatureSource("map").getBounds(); assertThat(bounds, equalTo(new ReferencedEnvelope(12.7856667, 13.2873561, 55.9254241, 56.2179056, DefaultGeographicCRS.WGS84))); } - @Test - public void shouldOpenDataStoreOnNonSpatialDatabase() { + @Test(expected = java.io.IOException.class) + public void shouldOpenDataStoreOnNonSpatialDatabase() throws IOException { GraphDatabaseService db = null; try { db = new TestGraphDatabaseFactory().newImpermanentDatabase(new File("other-db")); Neo4jSpatialDataStore store = new Neo4jSpatialDataStore(db); - ReferencedEnvelope bounds = store.getBounds("map"); - // TODO: rather should throw a descriptive exception - assertThat(bounds, equalTo(null)); + //will throw an exception + store.getFeatureSource("map").getBounds(); } finally { if (db != null) db.shutdown(); } diff --git a/src/test/java/org/neo4j/gis/spatial/OsmAnalysisTest.java b/src/test/java/org/neo4j/gis/spatial/OsmAnalysisTest.java index 58a06983f..ebed29e1f 100644 --- a/src/test/java/org/neo4j/gis/spatial/OsmAnalysisTest.java +++ b/src/test/java/org/neo4j/gis/spatial/OsmAnalysisTest.java @@ -58,7 +58,7 @@ import org.neo4j.graphdb.factory.GraphDatabaseFactory; import org.opengis.referencing.crs.CoordinateReferenceSystem; -import com.vividsolutions.jts.geom.Coordinate; +import org.locationtech.jts.geom.Coordinate; public class OsmAnalysisTest extends TestOSMImport { public static final String spatialTestMode = System.getProperty("spatial.test.mode"); @@ -497,4 +497,4 @@ public int compareTo(User other) { return -1 * ((Integer) changesets.size()).compareTo((Integer) other.changesets.size()); } } -} \ No newline at end of file +} diff --git a/src/test/java/org/neo4j/gis/spatial/ProgressLoggingListenerTest.java b/src/test/java/org/neo4j/gis/spatial/ProgressLoggingListenerTest.java index 83ce4df03..ed89f0763 100644 --- a/src/test/java/org/neo4j/gis/spatial/ProgressLoggingListenerTest.java +++ b/src/test/java/org/neo4j/gis/spatial/ProgressLoggingListenerTest.java @@ -27,6 +27,7 @@ import org.neo4j.gis.spatial.rtree.ProgressLoggingListener; import java.io.PrintStream; +import java.util.Locale; public class ProgressLoggingListenerTest { @@ -58,8 +59,9 @@ private void testProgressLoggingListenerWithSpecifiedWaits(int unitsOfWork, long } } listener.done(); + verify(out).println("Starting test"); - verify(out).println(String.format("%.2f (10/10) - Completed test", 100f)); + verify(out).println(String.format(Locale.ENGLISH,"%.2f (10/10) - Completed test", 100f)); verify(out, times(expectedLogCount)).println(anyString()); } } diff --git a/src/test/java/org/neo4j/gis/spatial/RTreeBulkInsertTest.java b/src/test/java/org/neo4j/gis/spatial/RTreeBulkInsertTest.java index 8f72621bf..9fdde8eef 100644 --- a/src/test/java/org/neo4j/gis/spatial/RTreeBulkInsertTest.java +++ b/src/test/java/org/neo4j/gis/spatial/RTreeBulkInsertTest.java @@ -1,7 +1,7 @@ package org.neo4j.gis.spatial; -import com.vividsolutions.jts.geom.Coordinate; -import com.vividsolutions.jts.geom.Geometry; +import org.locationtech.jts.geom.Coordinate; +import org.locationtech.jts.geom.Geometry; import org.apache.commons.io.FileUtils; import org.geotools.referencing.crs.DefaultEngineeringCRS; import org.junit.*; @@ -1356,7 +1356,7 @@ private List queryIndex(Layer layer, TestStats stats) { IndexTestConfig config = stats.config; long start = System.currentTimeMillis(); try (Transaction tx = db.beginTx()) { - com.vividsolutions.jts.geom.Envelope envelope = new com.vividsolutions.jts.geom.Envelope(config.searchMin, config.searchMax); + org.locationtech.jts.geom.Envelope envelope = new org.locationtech.jts.geom.Envelope(config.searchMin, config.searchMax); nodes = GeoPipeline.startWithinSearch(layer, layer.getGeometryFactory().toGeometry(envelope)).stream().map(GeoPipeFlow::getGeomNode).collect(Collectors.toList()); tx.success(); } diff --git a/src/test/java/org/neo4j/gis/spatial/ServerPluginTest.java b/src/test/java/org/neo4j/gis/spatial/ServerPluginTest.java index af2bbe605..8f058c743 100644 --- a/src/test/java/org/neo4j/gis/spatial/ServerPluginTest.java +++ b/src/test/java/org/neo4j/gis/spatial/ServerPluginTest.java @@ -31,7 +31,7 @@ import org.neo4j.graphdb.Node; import org.neo4j.graphdb.Transaction; -import com.vividsolutions.jts.geom.Envelope; +import org.locationtech.jts.geom.Envelope; public class ServerPluginTest extends Neo4jTestCase { diff --git a/src/test/java/org/neo4j/gis/spatial/TestDynamicLayers.java b/src/test/java/org/neo4j/gis/spatial/TestDynamicLayers.java index 36ee538b9..ff8436deb 100644 --- a/src/test/java/org/neo4j/gis/spatial/TestDynamicLayers.java +++ b/src/test/java/org/neo4j/gis/spatial/TestDynamicLayers.java @@ -38,9 +38,9 @@ import org.neo4j.gis.spatial.osm.OSMImporter; import org.neo4j.gis.spatial.osm.OSMLayer; -import com.vividsolutions.jts.geom.Coordinate; -import com.vividsolutions.jts.geom.LinearRing; -import com.vividsolutions.jts.geom.Polygon; +import org.locationtech.jts.geom.Coordinate; +import org.locationtech.jts.geom.LinearRing; +import org.locationtech.jts.geom.Polygon; import org.neo4j.graphdb.Transaction; public class TestDynamicLayers extends Neo4jTestCase implements Constants { diff --git a/src/test/java/org/neo4j/gis/spatial/TestIntersectsPathQueries.java b/src/test/java/org/neo4j/gis/spatial/TestIntersectsPathQueries.java index acb65e14f..c0d0e58d1 100644 --- a/src/test/java/org/neo4j/gis/spatial/TestIntersectsPathQueries.java +++ b/src/test/java/org/neo4j/gis/spatial/TestIntersectsPathQueries.java @@ -19,13 +19,13 @@ */ package org.neo4j.gis.spatial; -import com.vividsolutions.jts.geom.Coordinate; -import com.vividsolutions.jts.geom.Envelope; -import com.vividsolutions.jts.geom.Geometry; -import com.vividsolutions.jts.geom.GeometryFactory; -import com.vividsolutions.jts.geom.impl.CoordinateArraySequence; -import com.vividsolutions.jts.io.ParseException; -import com.vividsolutions.jts.simplify.TopologyPreservingSimplifier; +import org.locationtech.jts.geom.Coordinate; +import org.locationtech.jts.geom.Envelope; +import org.locationtech.jts.geom.Geometry; +import org.locationtech.jts.geom.GeometryFactory; +import org.locationtech.jts.geom.impl.CoordinateArraySequence; +import org.locationtech.jts.io.ParseException; +import org.locationtech.jts.simplify.TopologyPreservingSimplifier; import junit.framework.TestCase; diff --git a/src/test/java/org/neo4j/gis/spatial/TestOSMImport.java b/src/test/java/org/neo4j/gis/spatial/TestOSMImport.java index 6ebc1fa8e..d5a1e7455 100644 --- a/src/test/java/org/neo4j/gis/spatial/TestOSMImport.java +++ b/src/test/java/org/neo4j/gis/spatial/TestOSMImport.java @@ -19,8 +19,8 @@ */ package org.neo4j.gis.spatial; -import com.vividsolutions.jts.geom.Envelope; -import com.vividsolutions.jts.geom.Geometry; +import org.locationtech.jts.geom.Envelope; +import org.locationtech.jts.geom.Geometry; import junit.framework.Test; import junit.framework.TestSuite; diff --git a/src/test/java/org/neo4j/gis/spatial/TestProcess.java b/src/test/java/org/neo4j/gis/spatial/TestProcess.java index 27fd56be5..ea1af5ee2 100644 --- a/src/test/java/org/neo4j/gis/spatial/TestProcess.java +++ b/src/test/java/org/neo4j/gis/spatial/TestProcess.java @@ -30,10 +30,10 @@ import org.geotools.util.KVP; import org.opengis.feature.type.Name; -import com.vividsolutions.jts.geom.Geometry; -import com.vividsolutions.jts.geom.GeometryFactory; -import com.vividsolutions.jts.io.ParseException; -import com.vividsolutions.jts.io.WKTReader; +import org.locationtech.jts.geom.Geometry; +import org.locationtech.jts.geom.GeometryFactory; +import org.locationtech.jts.io.ParseException; +import org.locationtech.jts.io.WKTReader; public class TestProcess extends Neo4jTestCase { diff --git a/src/test/java/org/neo4j/gis/spatial/TestRemove.java b/src/test/java/org/neo4j/gis/spatial/TestRemove.java index 276c98d5e..dc42b0fec 100644 --- a/src/test/java/org/neo4j/gis/spatial/TestRemove.java +++ b/src/test/java/org/neo4j/gis/spatial/TestRemove.java @@ -19,8 +19,8 @@ */ package org.neo4j.gis.spatial; -import com.vividsolutions.jts.geom.Coordinate; -import com.vividsolutions.jts.geom.GeometryFactory; +import org.locationtech.jts.geom.Coordinate; +import org.locationtech.jts.geom.GeometryFactory; import org.neo4j.gis.spatial.index.LayerRTreeIndex; @@ -48,4 +48,4 @@ public void testAddMoreThanMaxNodeRefThenDeleteAll() throws Exception { Neo4jTestUtils.debugIndexTree(graphDb(), (LayerRTreeIndex) layer.getIndex()); } -} \ No newline at end of file +} diff --git a/src/test/java/org/neo4j/gis/spatial/TestSimplePointLayer.java b/src/test/java/org/neo4j/gis/spatial/TestSimplePointLayer.java index 4fa52394d..0ad51b729 100644 --- a/src/test/java/org/neo4j/gis/spatial/TestSimplePointLayer.java +++ b/src/test/java/org/neo4j/gis/spatial/TestSimplePointLayer.java @@ -19,9 +19,9 @@ */ package org.neo4j.gis.spatial; -import com.vividsolutions.jts.geom.Coordinate; -import com.vividsolutions.jts.geom.CoordinateList; -import com.vividsolutions.jts.geom.Point; +import org.locationtech.jts.geom.Coordinate; +import org.locationtech.jts.geom.CoordinateList; +import org.locationtech.jts.geom.Point; import junit.framework.AssertionFailedError; import org.geotools.data.neo4j.StyledImageExporter; import org.junit.Test; @@ -75,14 +75,14 @@ public void testSimplePointLayer() { try (Transaction tx = graphDb().beginTx()) { // finds geometries that contain the given geometry List results = GeoPipeline - .startContainSearch(layer, layer.getGeometryFactory().toGeometry(new com.vividsolutions.jts.geom.Envelope(15.0, 16.0, 56.0, 57.0))) + .startContainSearch(layer, layer.getGeometryFactory().toGeometry(new org.locationtech.jts.geom.Envelope(15.0, 16.0, 56.0, 57.0))) .toSpatialDatabaseRecordList(); // should not be contained assertEquals(0, results.size()); results = GeoPipeline - .startWithinSearch(layer, layer.getGeometryFactory().toGeometry(new com.vividsolutions.jts.geom.Envelope(15.0, 16.0, 56.0, 57.0))) + .startWithinSearch(layer, layer.getGeometryFactory().toGeometry(new org.locationtech.jts.geom.Envelope(15.0, 16.0, 56.0, 57.0))) .toSpatialDatabaseRecordList(); assertEquals(1, results.size()); @@ -101,14 +101,14 @@ public void testNativePointLayer() { try (Transaction tx = graphDb().beginTx()) { // finds geometries that contain the given geometry List results = GeoPipeline - .startContainSearch(layer, layer.getGeometryFactory().toGeometry(new com.vividsolutions.jts.geom.Envelope(15.0, 16.0, 56.0, 57.0))) + .startContainSearch(layer, layer.getGeometryFactory().toGeometry(new org.locationtech.jts.geom.Envelope(15.0, 16.0, 56.0, 57.0))) .toSpatialDatabaseRecordList(); // should not be contained assertEquals(0, results.size()); results = GeoPipeline - .startWithinSearch(layer, layer.getGeometryFactory().toGeometry(new com.vividsolutions.jts.geom.Envelope(15.0, 16.0, 56.0, 57.0))) + .startWithinSearch(layer, layer.getGeometryFactory().toGeometry(new org.locationtech.jts.geom.Envelope(15.0, 16.0, 56.0, 57.0))) .toSpatialDatabaseRecordList(); assertEquals(1, results.size()); diff --git a/src/test/java/org/neo4j/gis/spatial/TestSpatialQueries.java b/src/test/java/org/neo4j/gis/spatial/TestSpatialQueries.java index 81e0ded65..d6ed64702 100644 --- a/src/test/java/org/neo4j/gis/spatial/TestSpatialQueries.java +++ b/src/test/java/org/neo4j/gis/spatial/TestSpatialQueries.java @@ -25,10 +25,10 @@ import org.junit.Test; import org.neo4j.gis.spatial.pipes.GeoPipeline; -import com.vividsolutions.jts.geom.Envelope; -import com.vividsolutions.jts.geom.Geometry; -import com.vividsolutions.jts.io.ParseException; -import com.vividsolutions.jts.io.WKTReader; +import org.locationtech.jts.geom.Envelope; +import org.locationtech.jts.geom.Geometry; +import org.locationtech.jts.io.ParseException; +import org.locationtech.jts.io.WKTReader; import org.neo4j.graphdb.Transaction; public class TestSpatialQueries extends Neo4jTestCase { diff --git a/src/test/java/org/neo4j/gis/spatial/TestSpatialUtils.java b/src/test/java/org/neo4j/gis/spatial/TestSpatialUtils.java index a3ae1b089..233d12b64 100644 --- a/src/test/java/org/neo4j/gis/spatial/TestSpatialUtils.java +++ b/src/test/java/org/neo4j/gis/spatial/TestSpatialUtils.java @@ -29,12 +29,12 @@ import org.neo4j.gis.spatial.osm.OSMImporter; import org.neo4j.gis.spatial.osm.OSMLayer; -import com.vividsolutions.jts.geom.Coordinate; -import com.vividsolutions.jts.geom.Geometry; -import com.vividsolutions.jts.geom.GeometryFactory; -import com.vividsolutions.jts.geom.Point; -import com.vividsolutions.jts.linearref.LengthIndexedLine; -import com.vividsolutions.jts.linearref.LocationIndexedLine; +import org.locationtech.jts.geom.Coordinate; +import org.locationtech.jts.geom.Geometry; +import org.locationtech.jts.geom.GeometryFactory; +import org.locationtech.jts.geom.Point; +import org.locationtech.jts.linearref.LengthIndexedLine; +import org.locationtech.jts.linearref.LocationIndexedLine; public class TestSpatialUtils extends Neo4jTestCase { @@ -70,7 +70,7 @@ public void testJTSLinearRef() { * @param geometry */ private void debugLRS(Geometry geometry) { - LengthIndexedLine line = new com.vividsolutions.jts.linearref.LengthIndexedLine(geometry); + LengthIndexedLine line = new org.locationtech.jts.linearref.LengthIndexedLine(geometry); double length = line.getEndIndex() - line.getStartIndex(); System.out.println("Have Geometry: " + geometry); System.out.println("Have LengthIndexedLine: " + line); diff --git a/src/test/java/org/neo4j/gis/spatial/TestsForDocs.java b/src/test/java/org/neo4j/gis/spatial/TestsForDocs.java index 77ed35929..60d21de53 100644 --- a/src/test/java/org/neo4j/gis/spatial/TestsForDocs.java +++ b/src/test/java/org/neo4j/gis/spatial/TestsForDocs.java @@ -40,8 +40,8 @@ import org.neo4j.graphdb.Transaction; import org.neo4j.graphdb.factory.GraphDatabaseFactory; -import com.vividsolutions.jts.geom.Envelope; -import com.vividsolutions.jts.geom.Geometry; +import org.locationtech.jts.geom.Envelope; +import org.locationtech.jts.geom.Geometry; import org.neo4j.unsafe.batchinsert.BatchInserter; /** @@ -261,4 +261,4 @@ private void doGeometryTestsOnResults(Envelope bbox, List geometry.buffer(2); } -} \ No newline at end of file +} diff --git a/src/test/java/org/neo4j/gis/spatial/index/LayerIndexTestBase.java b/src/test/java/org/neo4j/gis/spatial/index/LayerIndexTestBase.java index 576434227..955d251dc 100644 --- a/src/test/java/org/neo4j/gis/spatial/index/LayerIndexTestBase.java +++ b/src/test/java/org/neo4j/gis/spatial/index/LayerIndexTestBase.java @@ -19,7 +19,7 @@ */ package org.neo4j.gis.spatial.index; -import com.vividsolutions.jts.geom.*; +import org.locationtech.jts.geom.*; import org.geotools.referencing.crs.DefaultGeographicCRS; import org.junit.After; import org.junit.Before; diff --git a/src/test/java/org/neo4j/gis/spatial/pipes/GeoPipesDocTest.java b/src/test/java/org/neo4j/gis/spatial/pipes/GeoPipesDocTest.java index 89bc557c3..b9dfb1181 100644 --- a/src/test/java/org/neo4j/gis/spatial/pipes/GeoPipesDocTest.java +++ b/src/test/java/org/neo4j/gis/spatial/pipes/GeoPipesDocTest.java @@ -56,12 +56,12 @@ import org.neo4j.kernel.impl.annotations.Documented; import org.neo4j.test.TestData.Title; -import com.vividsolutions.jts.geom.Coordinate; -import com.vividsolutions.jts.geom.Envelope; -import com.vividsolutions.jts.geom.Geometry; -import com.vividsolutions.jts.geom.util.AffineTransformation; -import com.vividsolutions.jts.io.ParseException; -import com.vividsolutions.jts.io.WKTReader; +import org.locationtech.jts.geom.Coordinate; +import org.locationtech.jts.geom.Envelope; +import org.locationtech.jts.geom.Geometry; +import org.locationtech.jts.geom.util.AffineTransformation; +import org.locationtech.jts.io.ParseException; +import org.locationtech.jts.io.WKTReader; import org.neo4j.test.TestGraphDatabaseFactory; public class GeoPipesDocTest extends AbstractJavaDocTestBase diff --git a/src/test/java/org/neo4j/gis/spatial/pipes/GeoPipesPerformanceTest.java b/src/test/java/org/neo4j/gis/spatial/pipes/GeoPipesPerformanceTest.java index 2071c7c2c..27c251486 100644 --- a/src/test/java/org/neo4j/gis/spatial/pipes/GeoPipesPerformanceTest.java +++ b/src/test/java/org/neo4j/gis/spatial/pipes/GeoPipesPerformanceTest.java @@ -30,7 +30,7 @@ import org.junit.Test; -import com.vividsolutions.jts.geom.Coordinate; +import org.locationtech.jts.geom.Coordinate; public class GeoPipesPerformanceTest extends Neo4jTestCase { private int records = 10000; diff --git a/src/test/java/org/neo4j/gis/spatial/pipes/OrthodromicDistanceTest.java b/src/test/java/org/neo4j/gis/spatial/pipes/OrthodromicDistanceTest.java index d1e1e62b6..cea1150fe 100644 --- a/src/test/java/org/neo4j/gis/spatial/pipes/OrthodromicDistanceTest.java +++ b/src/test/java/org/neo4j/gis/spatial/pipes/OrthodromicDistanceTest.java @@ -19,10 +19,10 @@ */ package org.neo4j.gis.spatial.pipes; -import com.vividsolutions.jts.geom.Coordinate; -import com.vividsolutions.jts.geom.GeometryFactory; -import com.vividsolutions.jts.geom.Point; -import com.vividsolutions.jts.geom.Polygon; +import org.locationtech.jts.geom.Coordinate; +import org.locationtech.jts.geom.GeometryFactory; +import org.locationtech.jts.geom.Point; +import org.locationtech.jts.geom.Polygon; import org.junit.Test; import org.neo4j.gis.spatial.pipes.processing.OrthodromicDistance; diff --git a/src/test/java/org/neo4j/gis/spatial/rtree/RTreeTests.java b/src/test/java/org/neo4j/gis/spatial/rtree/RTreeTests.java index c1d403c4b..733f48aa0 100644 --- a/src/test/java/org/neo4j/gis/spatial/rtree/RTreeTests.java +++ b/src/test/java/org/neo4j/gis/spatial/rtree/RTreeTests.java @@ -19,8 +19,8 @@ */ package org.neo4j.gis.spatial.rtree; -import com.vividsolutions.jts.geom.Coordinate; -import com.vividsolutions.jts.geom.GeometryFactory; +import org.locationtech.jts.geom.Coordinate; +import org.locationtech.jts.geom.GeometryFactory; import org.geotools.data.neo4j.Neo4jFeatureBuilder; import org.junit.Before; import org.junit.Test;