diff --git a/README.md b/README.md
index 22c1f5a95..c270d966b 100755
--- a/README.md
+++ b/README.md
@@ -74,6 +74,13 @@ This has meant that the spatial library needed a major refactoring to work with
and simply add on the rights to create tokens and indexes. In 0.27.2 we instead use `RestrictedAccessMode`
to restrict the users access right to the built in `AccessModel.Static.SCHEMA` and then boost to enable
index and token writes. The difference is subtle and should only be possible to notice in Enterprise Edition.
+* 0.28.0 tackles the ability to import multiple OSM files. The initial solution for Neo4j 4.x made use
+ of schema indexes keyed by the label and property. However, that means that all OSM imports would share
+ the same index. If they are completely disjointed data sets, this would not matter. But if you import
+ overlapping OSM files or different versions of the same file file, a mangled partial merger would result.
+ 0.28.0 solves this by using different indexes, and keeping all imports completely separate.
+ The more complex problems of importing newer versions, and stitching together overlapping areas, are not
+ yet solved.
Consequences of the port to Neo4j 4.x:
@@ -347,6 +354,7 @@ The Neo4j Spatial Plugin is available for inclusion in the server version of Neo
* [v0.27.0 for Neo4j 4.0.3](https://github.com/neo4j-contrib/m2/blob/master/releases/org/neo4j/neo4j-spatial/0.27.0-neo4j-4.0.3/neo4j-spatial-0.27.0-neo4j-4.0.3-server-plugin.jar?raw=true)
* [v0.27.1 for Neo4j 4.1.7](https://github.com/neo4j-contrib/m2/blob/master/releases/org/neo4j/neo4j-spatial/0.27.1-neo4j-4.1.7/neo4j-spatial-0.27.1-neo4j-4.1.7-server-plugin.jar?raw=true)
* [v0.27.2 for Neo4j 4.2.3](https://github.com/neo4j-contrib/m2/blob/master/releases/org/neo4j/neo4j-spatial/0.27.2-neo4j-4.2.3/neo4j-spatial-0.27.2-neo4j-4.2.3-server-plugin.jar?raw=true)
+ * [v0.28.0 for Neo4j 4.2.3](https://github.com/neo4j-contrib/m2/blob/master/releases/org/neo4j/neo4j-spatial/0.28.0-neo4j-4.2.3/neo4j-spatial-0.28.0-neo4j-4.2.3-server-plugin.jar?raw=true)
For versions up to 0.15-neo4j-2.3.4:
@@ -463,7 +471,7 @@ Add the following repositories and dependency to your project's pom.xml:
org.neo4jneo4j-spatial
- 0.27.2-neo4j-4.2.3
+ 0.28.0-neo4j-4.2.3
~~~
diff --git a/pom.xml b/pom.xml
index db64dbce9..e80dea01a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
4.0.0neo4j-spatialorg.neo4j
- 0.27.2-neo4j-4.2.3
+ 0.28.0-neo4j-4.2.3Neo4j - Spatial ComponentsSpatial utilities and components for Neo4jhttp://components.neo4j.org/${project.artifactId}/${project.version}
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 92c07120a..e5f7a029c 100644
--- a/src/main/java/org/neo4j/gis/spatial/osm/OSMImporter.java
+++ b/src/main/java/org/neo4j/gis/spatial/osm/OSMImporter.java
@@ -28,7 +28,6 @@
import org.neo4j.gis.spatial.rtree.Envelope;
import org.neo4j.gis.spatial.rtree.Listener;
import org.neo4j.gis.spatial.rtree.NullListener;
-import org.neo4j.gis.spatial.utilities.ReferenceNodes;
import org.neo4j.graphdb.*;
import org.neo4j.graphdb.schema.IndexDefinition;
import org.neo4j.graphdb.traversal.Evaluators;
@@ -41,10 +40,13 @@
import org.neo4j.kernel.impl.traversal.MonoDirectionalTraversalDescription;
import org.neo4j.kernel.internal.GraphDatabaseAPI;
+import javax.xml.bind.DatatypeConverter;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
import java.io.*;
import java.nio.charset.Charset;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
@@ -392,7 +394,7 @@ private OSMWriter(StatsManager statsManager, OSMImporter osmImporter) {
this.osmImporter = osmImporter;
}
- static OSMWriter fromGraphDatabase(GraphDatabaseService graphDb, SecurityContext securityContext, StatsManager stats, OSMImporter osmImporter, int txInterval) {
+ static OSMWriter fromGraphDatabase(GraphDatabaseService graphDb, SecurityContext securityContext, StatsManager stats, OSMImporter osmImporter, int txInterval) throws NoSuchAlgorithmException {
return new OSMGraphWriter(graphDb, securityContext, stats, osmImporter, txInterval);
}
@@ -867,8 +869,10 @@ private static class OSMGraphWriter extends OSMWriter {
private IndexDefinition relationIndex;
private IndexDefinition changesetIndex;
private IndexDefinition userIndex;
+ private final String layerHash;
+ private final HashMap