I've got a large Neo4J spatial database with around 1.5 million nodes in it.
It's come to my attention that the spatial index is corrupted - some nodes are cross linked:
match (n)<-[:RTREE_REFERENCE]-(a)<--(c),(n)<-[:RTREE_REFERENCE]-(b)<--(c) where id(a) <> id(b) return n,a,b,c limit 1;
returns:
{"table": {
"_response": {
"columns": ["n", "a", "b", "c"],
"data": [
{
"row": [
{
"wkt": "POINT (374075.17 164903.59)",
"id": 525155,
"gtype": 1,
"bbox_abc": [374075.17, 164903.59, 374075.17, 164903.59]
},
{
"bbox_xx": [374075.17, 164903.59, 374075.17, 164903.59]
},
{
"bbox_xx": [374075.17, 164903.59, 374075.17, 164903.59]
},
{
"bbox_xx": [373539, 164601, 376045, 165462]
}
],
======= CUT ======
"nodeMap": {
"118052": {
"bbox_xx": [374075.17, 164903.59, 374075.17, 164903.59]
},
"525156": {
"wkt": "POINT (374075.17 164903.59)",
"id": 525155,
"gtype": 1,
"bbox_abc": [374075.17, 164903.59, 374075.17, 164903.59]
},
"845986": {
"bbox_xx": [373539, 164601, 376045, 165462]
},
"846042": {
"bbox_xx": [374075.17, 164903.59, 374075.17, 164903.59]
}
},
}}
I thought that spatial index nodes ought to have a single RTREE_REFERENCE. How is it possible that mine has two. There are about 115 such nodes in the database with this issue.