Git Product home page Git Product logo

neo4j-contrib / spatial Goto Github PK

View Code? Open in Web Editor NEW
777.0 80.0 191.0 8.4 MB

Neo4j Spatial is a library of utilities for Neo4j that faciliates the enabling of spatial operations on data. In particular you can add spatial indexes to already located data, and perform spatial operations on the data like searching for data within specified regions or within a specified distance of a point of interest. In addition classes are provided to expose the data to geotools and thereby to geotools enabled applications like geoserver and uDig.

Home Page: http://neo4j-contrib.github.io/spatial

License: Other

Makefile 0.02% Scheme 52.13% Shell 0.14% HTML 0.09% Java 46.85% Python 0.11% Ruby 0.66%
neo4j neo4j-database geoserver spatial-data neo4j-spatial-plugin gis postgis geotools procedures neo4j-procedures

spatial's Introduction

Neo4j Spatial

build

Neo4j Spatial is a library facilitating the import, storage and querying of spatial data in the Neo4j open source graph database.

This projects manual is deployed as part of the local build as the Neo4j Spatial Manual.

Open Street Map

History

This library began as a collaborative vision between Neo-Technology and Craig Taverner in early 2010. The bulk of the initial work was done by Davide Savazzi as part of his 2010 Google Summer of Code (GSoC) project with Craig as mentor, as a project within the OSGeo GSoC program. In 2011 and 2012 two further GSoC projects contributed, the last of which saw Davide return as mentor.

The original vision for the library was a comprehensive suite of GIS capabilities somewhat inspired by PostGIS, while remaining aligned with the graph-nature of the underlying Neo4j database. To achieve this lofty goal the JTS and GeoTools libraries were used, giving a large suite of capabilities very early on.

However, back in 2010 Neo4j was an embedded database with deployments that saw a low level of concurrent operation. However, for many years now, Neo4j has been primarily deployed in high concurrent server environments. Over the years there have been various efforts to make the library more appropriate for use in these environments:

  • REST API (early Neo4j 1.x servers had no Cypher)
  • IndexProvider mechanism (used during Neo4j 1.x and 2.x server, and removed for Neo4j 3.0)
  • 0.23: Addition of Cypher procedures for Neo4j 3.0
  • 0.24: Addition of a high performance bulk importer to the in-graph RTree index
  • 0.25: Addition of GeoHash indexes for point layers
  • 0.26: Support for native Neo4j point types
  • 0.27: Major port to Neo4j 4.x which deprecated many of the Neo4j API's the library depended on
  • 0.29: Port to Neo4j 5.13

However, despite all these improvements, the core of the library only exposes the rich capabilities of JTS and GeoTools if used in an embedded environment. The large effort required to port the library to Neo4j 4.0 resulted in many backwards incompatibilities and highlighted the need for a new approach to spatial libraries for Neo4j.

Neo4j 4.x Support

This library was originally written in 2010 when Neo4j was still releasing early 1.x versions. This means it made use of internal Java API's that were deprecated over the years, some as early as Neo4j 2.x. When Neo4j 4.0 was released, many deprecated APIs were entirely removed. And the transaction API was changed in a fundamental way. This has meant that the spatial library needed a major refactoring to work with Neo4j 4.x:

  • The library previously depended on nested transactions. This allowed code that was called within a transaction (like procedures) to be the same as code that was not (Java API). The removal of this support required that all internal API's needed to include parameters for the current transaction, and only the specific surface designed for embedded use not have that.
  • The library made use of Lucene based explicit indexes in many places. The removal of support for explicit indexes required completely new solutions in several places:
    • The OSMImporter will instead now use normal Neo4j schema indexes (introduced in 2.0). However, these can only be created in separate index transactions. Due to the new transaction model this requires stopping the import transaction, starting an index transaction, and then restarting the import transaction. All of this is incompatible with procedures, which already have an incoming, non-stoppable transaction. The solution to this second problem was to run the actual import in another thread. This has the additional benefit of retaining the original batch-processing capabilities. The negative consequence of this it that it requires modifying the security model of the procedure context.
    • The ExplicitIndexBackedPointIndex has been modified to instead use a schema index. This required similar tricks to those employed in the OSMImporter described above.
  • Neo4j 4.0 runs only in Java 11, and until recently GeoTools did not support newer Java versions. It was therefor necessary to upgrade the GeoTools libraries to version 24.2. This in turn required a re-write of the Neo4jDataStore interface since the older API had long been deprecated, and was entirely unavailable in newer versions.
  • Neo4j 4.1 was slightly stricter in regard to passing nodes as parameters, requiring the nodes objects to have been created in the current transaction. To work around this we added .byId versions of the spatial.addNode and spatial.removeNode procedures. We also changed the spatial.removeNode procedures to return nodeId instead of node.
  • The change to Neo4j 4.2 was more subtle. Mostly only internal API's around the use of Path instead of File. One change that could be noticed was the IndexManager.IndexAccessMode class. In the 0.27.0 and 0.27.1 versions we used OverridenAccessMode to take the users existing access mode 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, 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.
  • Neo4j 4.3 has an issue with leaking RelationshipTraversalCursor, and we needed to do some workarounds to avoid this issue, usually by exhausting the iterator, which can have a higher performance cost in some cases. Version 0.28.1 includes this fix.

Consequences of the port to Neo4j 4.x:

  • The large number of changes mean that the 0.27.x versions should be considered very alpha.
  • Many API's have changed and client code might need to be adapted to take the changes into account.
  • The new DataStore API is entirely untested in GeoServer, besides the existing unit and integration tests.
  • The need to manage threads and create schema indexes results in the procedures requiring unrestricted access to internal API's of Neo4j.

This last point means that you need to set the following in your neo4j.conf file:

dbms.security.procedures.unrestricted=spatial.*

If you are concerned about the security implications of unrestricted access, my best advice is to review the code and decide for yourself the level of risk you face. See, for example, the method IndexAccessMode.withIndexCreate, which adds index create capabilities to the security model. This means that users without index creation privileges will be able to create the necessary spatial support indexes described above. This code was not written because we wanted to allow for that case, it was written because in the Neo4j security model, procedures that can write data (mode=WRITE) are not allowed to create indexes. So this security-fix was required even in the Community Edition of Neo4j.


The rest of the README might have information that is no longer accurate for the current version of this library. Please report any mistakes as issues, or consider raising a pull-request with an appropriate fix.

Concept Overview

The key concepts of this library include:

  • Allow the user to model geograph data in whatever way they wish, through providing an adapter ( extend GeometryEncoder). Built-in encoders include:
    • WKT and WKB stored as properties of nodes
    • Simple points as properties of nodes (two doubles, or a double[] or a native Neo4j Point)
    • OpenStreetMap with complex geometries stored as sub-graphs to reflect the original topology of the OSM model
  • Multiple CoordinationReferenceSystem support using GeoTools
  • Support the concept of multiple geographic layers, each with its own CRS and Index
  • Include an index capable of searching for complex geometries (in-graph RTree index)
  • Support import and export in a number of known formats (e.g. Shapefile and OSM)
  • Embed the library and Neo4j within GIS tools like uDig and GeoServer

Some key features include:

  • Utilities for importing from ESRI Shapefile as well as Open Street Map files
  • Support for all the common geometry types
  • An RTree index for fast searches on geometries
  • Support for topology operations during the search (contains, within, intersects, covers, disjoint, etc.)
  • The possibility to enable spatial operations on any graph of data, regardless of the way the spatial data is stored, as long as an adapter is provided to map from the graph to the geometries.
  • Ability to split a single layer or dataset into multiple sub-layers or views with pre-configured filters
  • Server Plugin for Neo4j Server 2.x and 3.x
    • REST API for creating layers and adding nodes or geometries to layers
    • IndexProvider API (2.x only) for Cypher access using START node=node:geom({query})
    • Procedures (3.x only) for much more comprehensive access to spatial from Cypher

Index and Querying

The current index is an RTree index, but it has been developed in an extensible way allowing for other indices to be added if necessary. The spatial queries implemented are:

  • Contain
  • Cover
  • Covered By
  • Cross
  • Disjoint
  • Intersect
  • Intersect Window
  • Overlap
  • Touch
  • Within
  • Within Distance

Building

The simplest way to build Neo4j Spatial is by using maven. Just clone the git repository and run

mvn install

This will download all dependencies, compiled the library, run the tests and install the artifact in your local repository. The spatial plugin will also be created in the target directory, and can be copied to your local server using instructions on the spatial server plugin below.

Layers and GeometryEncoders

The primary type that defines a collection of geometries is the Layer. A layer contains an index for querying. In addition, a Layer can be an EditableLayer if it is possible to add and modify geometries in the layer. The next most important interface is the GeometryEncoder.

The DefaultLayer is the standard layer, making use of the WKBGeometryEncoder for storing all geometry types as byte[] properties of one node per geometry instance.

The OSMLayer is a special layer supporting Open Street Map and storing the OSM model as a single fully connected graph. The set of Geometries provided by this layer includes Points, LineStrings and Polygons, and as such cannot be exported to Shapefile format, since that format only allows a single Geometry per layer. However, OMSLayer extends DynamicLayer, which allow it to provide any number of sub-layers, each with a specific geometry type and in addition based on an OSM tag filter. For example, you can have a layer providing all cycle paths as LineStrings, or a layer providing all lakes as Polygons. Underneath these are all still backed by the same fully connected graph, but exposed dynamically as apparently separate geometry layers.

Examples

Importing a shapefile

Spatial data is divided in Layers and indexed by a RTree.

GraphDatabaseService database = new GraphDatabaseFactory().newEmbeddedDatabase(storeDir);
try{
	ShapefileImporter importer = new ShapefileImporter(database);
	importer.importFile("roads.shp","layer_roads");
} finally {
	database.shutdown();
}

If using the server, the same can be achieved with spatial procedures (3.x only):

CALL spatial.addWKTLayer('layer_roads', 'geometry')
CALL spatial.importShapefileToLayer('layer_roads', 'roads.shp')

Importing an Open Street Map file

This is more complex because the current OSMImporter class runs in two phases, the first requiring a batch-inserter on the database. There is ongoing work to allow for a non-batch-inserter on the entire process, and possibly when you have read this that will already be available. Refer to the unit tests in classes TestDynamicLayers and TestOSMImport for the latest code for importing OSM data. At the time of writing the following worked:

OSMImporter importer = new OSMImporter("sweden");
Map<String, String> config = new HashMap<String, String>();
config.put("neostore.nodestore.db.mapped_memory", "90M" );
config.put("dump_configuration", "true");
config.put("use_memory_mapped_buffers", "true");
BatchInserter batchInserter = BatchInserters.inserter(new File(dir), config);
importer.importFile(batchInserter, "sweden.osm", false);
batchInserter.shutdown();

GraphDatabaseService db = new GraphDatabaseFactory().newEmbeddedDatabase(dir);
importer.reIndex(db, 10000);
db.shutdown();

Executing a spatial query

GraphDatabaseService database = new GraphDatabaseFactory().newEmbeddedDatabase(storeDir);
try {
	SpatialDatabaseService spatialService = new SpatialDatabaseService(database);
	Layer layer = spatialService.getLayer("layer_roads");
	SpatialIndexReader spatialIndex = layer.getIndex();
		
	Search searchQuery = new SearchIntersectWindow(new Envelope(xmin, xmax, ymin, ymax));
	spatialIndex.executeSearch(searchQuery);
	List<SpatialDatabaseRecord> results = searchQuery.getResults();
} finally {
	database.shutdown();
}

If using the server, the same can be achieved with spatial procedures (3.x only):

CALL spatial.bbox('layer_roads', {lon: 15.0, lat: 60.0}, {lon: 15.3, lat: 61.0})

Or using a polygon:

WITH 'POLYGON((15.3 60.2, 15.3 60.4, 15.7 60.4, 15.7 60.2, 15.3 60.2))' AS polygon
CALL spatial.intersects('layer_roads', polygon) YIELD node
RETURN node.name AS name

For further Java examples, refer to the test code in the LayersTest and the TestSpatial classes.

For further Procedures examples, refer to the code in the SpatialProceduresTest class.

Neo4j Spatial Geoserver Plugin

IMPORTANT: Examples in this readme were originally tested with GeoServer 2.1.1. However, regular testing of new releases of Neo4j Spatial against GeoServer is not done, and so we welcome feedback on which versions are known to work, and which ones do not, and perhaps some hints as to the errors or problems encountered.

Each release of Neo4j Spatial builds against a specific version of GeoTools and should then be used in the version of GeoServer that corresponds to that. The list of releases below starting at Neo4j 2.0.8 were built with GeoTools 9.0 for GeoServer 2.3.2, but most release for Neo4j 3.x were ported to GeoTools 14.4 for GeoServer 2.8.4.

For the port to Neo4j 4.0 we needed to upgrade GeoTools to 24.x to avoid bugs with older GeoTools in Java 11. This also required a complete re-write of the Neo4jDataStore and related classes. This has not been tested at all in any GeoTools enabled application, but could perhaps work with GeoServer 2.18.

Building

mvn clean install

Deployment into Geoserver

  • unzip the target/xxxx-server-plugin.zip and the Neo4j libraries from your Neo4j download under $NEO4J_HOME/lib into $GEOSERVER_HOME/webapps/geoserver/WEB-INF/lib
  • restart geoserver
  • configure a new workspace
  • configure a new datasource neo4j in your workspace. Point the "The directory path of the Neo4j database:" parameter to the relative (form the GeoServer working dir) or absolute path to a Neo4j Spatial database with layers ( see Neo4j Spatial)
  • in Layers, do "Add new resource" and choose your Neo4j datastore to see the existing Neo4j Spatial layers and add them.

Testing in GeoServer trunk

  • check out the geoserver source
svn co https://svn.codehaus.org/geoserver/trunk geoserver-trunk
  • build the source
cd geoserver-trunk
mvn clean install
cd src/web/app
mvn jetty:run
<profile>
	<id>neo4j</id>
	<dependencies>
		<dependency>
			<groupId>org.neo4j</groupId>
			<artifactId>neo4j-spatial</artifactId>
			<version>5.20.0</version>
		</dependency>
	</dependencies>
</profile>

The version specified on the version line can be changed to match the version you wish to work with (based on the version of Neo4j itself you are using). To see which versions are available see the list at Neo4j Spatial Releases.

  • start the GeoServer webapp again with the added neo4j profile
    cd $GEOSERVER_SRC/src/web/app
    mvn jetty:run -Pneo4j

Using Neo4j Spatial with uDig

For more info head over to Neo4j Wiki on uDig (This wiki is currently dead, but there appears to be a working mirror in Japan at http://oss.infoscience.co.jp/neo4j/wiki.neo4j.org/content/Neo4j_Spatial_in_uDig.html).

Using the Neo4j Spatial Server plugin

The Neo4j Spatial Plugin is available for inclusion in the server version of Neo4j 2.x, Neo4j 3.x and Neo4j 4.x.

For versions up to 0.15-neo4j-2.3.4:

    #install the plugin
    unzip neo4j-spatial-XXXX-server-plugin.zip -d $NEO4J_HOME/plugins
    
    #start the server
    $NEO4J_HOME/bin/neo4j start

    #list REST API (edit to correct password)
    curl -u neo4j:neo4j http://localhost:7474/db/data/

For versions for neo4j 3.0 and later:

    #install the plugin
    cp neo4j-spatial-XXXX-server-plugin.jar $NEO4J_HOME/plugins/
    
    #start the server
    $NEO4J_HOME/bin/neo4j start

    #list REST API (edit to correct password)
    curl -u neo4j:neo4j http://localhost:7474/db/data/

    #list spatial procedures (edit to correct password)
    curl -u neo4j:neo4j -H "Content-Type: application/json" -X POST -d '{"query":"CALL spatial.procedures"}' http://localhost:7474/db/data/cypher

The server plugin provides access to the internal spatial capabilities using three APIs:

  • A REST API for creating layers and adding nodes or geometries to layers.
    • For usage information see Neo4j Spatial Manual REST
    • Note that this API provides only limited access to Spatial, with no access the GeoPipes or import utilities
    • This API was entirely removed when support for Neo4j 4.0 was added (version 0.27)
  • An IndexProvider API (2.x only) for Cypher access using START node=node:geom({query})
    • It is only possible to add nodes and query for nodes, and the resulting graph structure is not compatible with any other spatial API (not compatible with Java API, REST or Procedures), so if you use this approach, do not blend it with the other approaches.
    • There is some brief documentation at Finding geometries within distance using cypher
    • This API was removed for 3.0 releases, and so is only available for Neo4j 2.x
  • Procedures for much more comprehensive access to spatial from Cypher
    • Documentation is not yet available, but you can list the available procedures within Neo4j using the query CALL spatial.procedures
    • This API uses the Procedures capabilities released in Neo4j 3.0, and is therefor not available for Neo4j 2.x

During the Neo4j 3.x releases, support for spatial procedures changed a little, through the addition of various new capabilities. They were very quickly much more capable than the older REST API, making them by far the best option for accessing Neo4j remotely or through Cypher.

The Java API (the original API for Neo4j Spatial) still remains, however, the most feature rich, and therefor we recommend that if you need to access Neo4j server remotely, and want deeper access to Spatial functions, consider writing your own Procedures. The Neo4j 3.0 documentation provides some good information on how to do this, and you can also refer to the Neo4j Spatial procedures source code for examples.

Building Neo4j spatial

git clone https://github.com/neo4j-contrib/spatial/spatial.git
cd spatial
mvn clean package

Building Neo4j Spatial Documentation

Add your GitHub credentials in your ~/.m2/settings.xml

<settings>
	<servers>
		<server>
			<id>github</id>
			<username>[email protected]</username>
			<password>secret</password>
		</server>
	</servers>
</settings>

To build and deploy:

git clone https://github.com/neo4j/spatial.git
cd spatial
mvn clean install site -Pneo-docs-build  

Using Neo4j spatial in your Java project with Maven

Add the following repositories and dependency to your project's pom.xml:

<dependency>
	<groupId>org.neo4j</groupId>
	<artifactId>neo4j-spatial</artifactId>
	<version>5.20.0</version>
</dependency>

The version specified on the last version line can be changed to match the version you wish to work with (based on the version of Neo4j itself you are using). To see which versions are available see the list at Neo4j Spatial Releases.

Running Neo4j spatial code from the command-line

Some of the classes in Neo4j-Spatial include main() methods and can be run on the command-line. For example there are command-line options for importing SHP and OSM data. See the main methods in the OSMImporter and ShapefileImporter classes. Here we will describe how to set up the dependencies for running the command-line, using the OSMImporter and the sample OSM file two-street.osm. We will show two ways to run this on the command line, one with the java command itself, and the other using the 'exec:java' target in maven. In both cases we use maven to set up the dependencies.

Compile

git clone git://github.com/neo4j-contrib/spatial.git
cd spatial
mvn clean compile

Run using JAVA command

mvn dependency:copy-dependencies
java -cp target/classes:target/dependency/* org.neo4j.gis.spatial.osm.OSMImporter osm-db two-street.osm 

Note: On windows remember to separate the classpath with ';' instead of ':'.

The first command above only needs to be run once, to get a copy of all required JAR files into the directory target/dependency. Once this is done, all further java commands with the -cp specifying that directory will load all dependencies. It is likely that the specific command being run does not require all dependencies copied, since it will only be using parts of the Neo4j-Spatial library, but working out exactly which dependencies are required can take a little time, so the above approach is most certainly the easiest way to do this.

Run using 'mvn exec:java'

mvn exec:java -Dexec.mainClass=org.neo4j.gis.spatial.osm.OSMImporter -Dexec.args="osm-db two-street.osm"

Note that the OSMImporter cannot re-import the same data multiple times, so you need to delete the database between runs if you are planning to do that.

spatial's People

Contributors

actions-user avatar amorgner avatar andreaswilhelm avatar andy2003 avatar ayosec avatar bm3780 avatar cmorgner avatar craigtaverner avatar darabi avatar digitalstain avatar dwins avatar eebus avatar ehx-v1 avatar infiniverse avatar jexp avatar jjaderberg avatar johnw424 avatar johnymontana avatar jonathanwin avatar kiteflo avatar lassewesth avatar lojjs avatar nawroth avatar patrick-fitzgerald avatar phil20686 avatar sarmbruster avatar simpsonjulian avatar svzdvd avatar tbaum avatar zavan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spatial's Issues

index on wkt property not removed cleanly

(http://groups.google.com/group/neo4j/browse_thread/thread/630dc8ce8c87cf06)

it seems when deleteing a node containing a wkt property the wkt property is not removed from the index, even the node is cleanly removed from the DB. This might result in a NotFoundException in case of spatial search execution as nodes will be returned which actually are no more present in the DB.

Workaround/hack: catch NotFoundException and treat this as a common bahavior..

cheers, Florian;

Gremlin spatial query not returning results

This works:

POST /db/data/ext/SpatialPlugin/graphdb/findGeometriesInLayer {"layer":"UsersWorld","minx":"-71.070231297681","maxx":"-71.091167203206","miny":"42.351920260159","maxy":"42.375030765981"}

This does not:

http> POST /db/data/ext/GremlinPlugin/graphdb/execute_script {"script":"g.idx('UsersWorld').get('bbox','[-71.070231297681, 42.351920260159, -71.091167203206, 42.375030765981]')"}
==> 200 OK
==> "javax.script.ScriptException: java.lang.NullPointerException"

Help!

previousGeomNode points to deleted node when tx is rolled back

In EditableLayerImpl (https://github.com/neo4j/spatial/blob/master/src/main/java/org/neo4j/gis/spatial/EditableLayerImpl.java) there's a local cache for the last geometry node added to a spatial index layer.

In case of a rollback of the root transaction in which a geometry node was added, this cache will still point to a non-comitted node, so any later access to previousGeomNode leads to a NotFoundException in addGeomNode here:

previousGeomNode.createRelationshipTo(geomNode, SpatialRelationshipTypes.NEXT_GEOM);

which makes the layer index completely unwritable because there's no way to reset previousGeomNode.

A quick fix would to disable caching (see #60). This might have an impact on performance because the last added node would have been determined each time, but I wasn't able to create a better solution today.

private Node addGeomNode(Geometry geom, String[] fieldsName, Object[] fields) {

    Node geomNode = getDatabase().createNode();
    Node previousGeomNode = null; // local

    [...]

Maybe the whole thing in addGeomNode can be further optimized, e.g. with a Cypher query. It seems to be a traversal over all geometries being iterated afterwards just to find the previously added node.

Another solution perhaps would be to synchronize the cached node with transaction stuff, but that seems a fairly amount of work to me.

Unable to build older version on fresh Maven / Java installation

Until the latest version of Neo4j Spatial builds, we're using an older checkout (and building against Neo4j 1.6) -- however, on a fresh Java & Maven installation on our deployment server, it refuses to build, citing a dependency error. The full output is at https://gist.github.com/2551961 -- the offending POM (http://maven.glassfish.org/content/groups/glassfish/net/java/jvnet-parent/1/jvnet-parent-1.pom) seems to have been moved by Oracle?

Can anyone help with this?

Unable to load the same OSM data in two different layers.

Exception:

java.util.NoSuchElementException: More than one element in org.neo4j.index.impl.lucene.LuceneIndex$1@7b7d1256. First element is 'Node[14]' and the second element is 'Node[2042]'
    at org.neo4j.helpers.collection.IteratorUtil.singleOrNull(IteratorUtil.java:116)
    at org.neo4j.index.impl.lucene.IdToEntityIterator.getSingle(IdToEntityIterator.java:88)
    at org.neo4j.index.impl.lucene.IdToEntityIterator.getSingle(IdToEntityIterator.java:1)
    at org.neo4j.gis.spatial.osm.OSMImporter$OSMGraphWriter.getOSMNode(OSMImporter.java:917)
    at org.neo4j.gis.spatial.osm.OSMImporter$OSMGraphWriter.getOSMNode(OSMImporter.java:727)
    at org.neo4j.gis.spatial.osm.OSMImporter$OSMWriter.createOSMWay(OSMImporter.java:575)
    at org.neo4j.gis.spatial.osm.OSMImporter.importFile(OSMImporter.java:1480)
    at org.neo4j.gis.spatial.osm.OSMImporter.importFile(OSMImporter.java:1314)
    at org.neo4j.gis.spatial.osm.OSMImporter.importFile(OSMImporter.java:1306)

The following Lucene search finds more than one Node and throws an exception. Only the Node inside the current Layer should be returned:

            Node node = changesetNodes.get(osmId);
            if (node == null) {
                logNodeFoundFrom("node-index");
                return indexFor("node").get("node_osm_id", osmId).getSingle();
            } else {
                logNodeFoundFrom("changeset");
                return node;
            }

Failing dependencies (pom.xml) / image-processing broken when using 0.9SNAPSHOT

Hi,

when I add neo4j-spatial to my pom.xml[1], i get the following error on resolving dependencies:

Some projects fail to be resolved
Impossible to resolve dependencies of tiramisu#gastronom;0.0.1-SNAPSHOT unresolved dependency: jgridshift#jgridshift;1.0: not found
download failed: javax.media#jai_core;1.1.3!jai_core.jar

I get a similar error when adding neo4j-spatial-0.8([2]).

This error is annoying on the one hand, on the other hand it breaks my image-processing.
Following error appears when I am using "ImageIO.write()", which works fine without having neo4j-spatial-0.9SNAPSHOT in the pom.xml:

java.lang.NoClassDefFoundError: javax/media/jai/widget/ScrollingImagePanel
at it.geosolutions.imageioimpl.plugins.tiff.TIFFImageWriterSpi.onRegistration(TIFFImageWriterSpi.java:145)
at javax.imageio.spi.SubRegistry.registerServiceProvider(ServiceRegistry.java:715)
at javax.imageio.spi.ServiceRegistry.registerServiceProvider(ServiceRegistry.java:302)
at javax.imageio.spi.IIORegistry.registerApplicationClasspathSpis(IIORegistry.java:211)
at javax.imageio.spi.IIORegistry.<init>(IIORegistry.java:138)
at javax.imageio.spi.IIORegistry.getDefaultInstance(IIORegistry.java:159)
at javax.imageio.ImageIO.<clinit>(ImageIO.java:65)
at domain.services.QRCodeService.createQRCode(QRCodeService.java:26)
[...]

For time being, i am unsing neo4j-spatial 0.8 to avoid the image-processing problem.

As far as I can see, this issue is caused by your dependency to geotools. Maybe it's a solution to exclude geotools image-processing.

[1]

org.neo4j
neo4j-spatial
0.9-SNAPSHOT

[2]
download failed: javax.media#jai_core;1.1.3!jai_core.jar

LayerNodeIndex only supports Point[lat/long, WKT]

The settings of LayerNodeIndex only allows the following configurations:

Points with Lat/Long sourced from properties (named at will)
Points sourced from a WKT property (named at will) [But will accept any geometry, in practice]
Any geometry sourced from a WKB property named "" (expected non-functional)

I think it should support the following:

  • Points with Lat/Long sourced from properties (named at will)
  • Any geometry from a WKT property (named at will)
  • Any geometry from a WKB property (named at will)

Plus, maybe:

  • Points from a WKT property (named at will)
  • Points from a WKB property (named at will)

Currently, Points from WKT are implemented the same as any geometry (uses WKTPropertyEncoder), and the Point nature of the index seems otherwise unused. Separating WKT/WKB points from any geometry therefore seems unnecessary.

see https://groups.google.com/forum/#!topic/neo4j/SIxUsF2EExc "neo4j-spatial: Creating a WKT-based index for polygon geometries"

Pull request to follow.

no index provider 'lucene' found

I get this when running 'mvn install'

OSM-Import[points:true\u002C batch:false]: one-street.osm(org.neo4j.gis.spatial.TestOSMImport$1): No index provider 'lucene' found.

shouldn't there be a dependency in the pom for this?

Build failure due to asm dependency

This isn't a problem with neo4j spatial, but is causing the build to fail. I've resolved the issue by manually altering my m2 repository to include the correct asm-3.1.pom and asm-3.1.jar in /asm/3.1 and adding /asm-parent/3.1/asm-parent-3.1.pom. These files were available from the asm website.

Cheers,

_Chris

Note: This occurred using maven 2.

geoserver plugin error when creating new store

Hi,

I am able to get the geoserver plugin installed, and geoserver displays the neo4j-spatial data store option. However, when I configure a new data store and attempt to save, nothing happens. If I navigate to the data source listing in geoserver, I don't see my new neo4j data source. When I try to create again, I get this:

Error creating data store, check the parameters. Error message: Unable to lock store [/Applications/GeoServer.app/Contents/Resources/Java/neo4jdb/neostore.relationshiptypestore.db.names], this is usually caused by another Neo4j kernel already running in this JVM for this particular store

I've tried this on an empty directory, and an existing neo4j-spatial index directory.

OutOfMemoryError: PermGen space

Hi,

After following the README for getting mapserver running with Neo4J-spatial, I see this error as soon as I log in as admin:

07 Sep 21:11:30 ERROR [wicket.Session] - Exception when detaching/serializing page
java.lang.OutOfMemoryError: PermGen space

The command I'm running is:

mvn jetty:run -Pneo4j

Mapserver seems to start-up just fine, but the login bombs it out.

Is there a way to bump up memory? Is this expected?

special chars mess up checkout

Special characters like in: "fรถrstadsgatan" in LayersTest get messed up in my checkout. Even if that could be a setting of mine, I would suggest to keep them out of the code.

They produce stuff like:
Coordinate crossing_bygg_fรƒยถrstadsgatan = new Coordinate( 13.0171471,
55.6074148 );
Coordinate[] waypoints_fรƒยถrstadsgatan = {
new Coordinate( 13.0201511, 55.6066846 ),
crossing_bygg_fรƒยถrstadsgatan };

Which obviously doesn't compile.

Poor Performance for EditableLayerImpl#addGeomNode

EditableLayerImpl#addGeomNode finds the last geo node in the traversal path. For longer paths where there are a large number of nodes in the layer, the logic to traverse the entire path just to find the last node will result in unacceptable performance. Using a postorderBreadthFirst ordering will vastly improve the performace, as the levels are selected starting at the deepest depths.

See https://github.com/bm3780/spatial/commit/60accf4d8cb3310f327edb0e2233ae15a9a1426b for changes.

server plugin zip

in Using the Neo4j Spatial Server plugin section of the readme it says that Neo4j Spatial is also packaged as a ZIP file that can be unzipped into the Neo4j Server /plugin directory.

where can i find this plugin?

build failure

I am trying to build neo4j-spatial

but

[INFO]

[INFO] BUILD FAILURE

[INFO]

[INFO] Total time: 36:36.406s
[INFO] Finished at: Sun Mar 11 22:34:38 KST 2012
[INFO] Final Memory: 9M/17M

[INFO]

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-
plugin:2.9:test (default-test) on project neo4j-spatial: There are
test failures.
[ERROR]
[ERROR] Please refer to C:\dev\neo4j_udig\neo4j\spatial\target
\surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with
the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions,
please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

maven version problem??

in pom.xml

  <plugin>
    <artifactId>maven-surefire-plugin</artifactId>
    <!-- <version>2.7.1</version> -->
        <version>2.7.1</version>
    <configuration>
      <argLine>-server -Xms512m -Xmx2500m -XX:+UseConcMarkSweepGC</argLine>
    </configuration>
  </plugin>

is this not problem?

build doesn't work out of the box

For some reason I couldn't get the mvn build work with the geotools 2.7-M3 version.
Putting it to 2.7-SNAOSHOT did the trick. Apart of the version, non geotools people might be helpless here. Just to let you know.

Refactor LayerNode Index

Simplify lookup methods by putting the behavior into different classes.

Implement putIfAbsent, make sure that remove removes the node.

Improve exception handling (e.g. in remove)

FilterCQL failure

org.neo4j.gis.spatial.pipes.filtering.FilterCQL doesn't seem to behave as expected.

After creating a filter like this...
FilterCQL filter = new FilterCQL(osmLayer,"highway is not null and geometryType(the_geom) = 'LineString'" );

...operations with the filter filter.hasNext() gives null. Using the same cql for a dynamic layer works.

ClassNotFoundException in LayerNodeIndex

neo4j-spatial (0.8 release) has a mandatory dependency on GremlinGroovyPipeline in com.tinkerpop.gremlin.groovy, but in the pom.xml, the dependency is only of type 'provided'.

This leads to a CNFE here:

java.lang.NoClassDefFoundError: com/tinkerpop/gremlin/groovy/GremlinGroovyPipeline
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
at org.neo4j.gis.spatial.indexprovider.LayerNodeIndex.query(LayerNodeIndex.java:237)

non batch OSM parser

Is there a 'non batch' OSM inserter? There were allusions to this but I can't seem to find any and the OSMBatchInserter blows up with an out-of-memory exception with a large number of Nodes/Ways. I'd be happy to use ruby or python but can't seem to get those setup either.

Build Failure

Hi,

After the 1.7 update I'm getting a build failure. Here's the full message:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6:21.366s
[INFO] Finished at: Sat Apr 28 02:06:12 BST 2012
[INFO] Final Memory: 11M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project neo4j-spatial: Could not resolve dependencies for project org.neo4j:neo4j-spatial:jar:0.8-SNAPSHOT: Could not find artifact org.neo4j:neo4j-lucene-index:jar:1.7-SNAPSHOT in osgeo (http://download.osgeo.org/webdav/geotools/) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

findClosestPointsTo(Coordinate, double) not honoring user-supplied distance

While implementing a function on top of SimplePointLayer I found a flaw in the above function. The second parameter (distance) is never used but the function always searches with a fixed radius of 10km. The fix is quite easy:

SearchPointsWithinOrthodromicDistance distanceQuery = new SearchPointsWithinOrthodromicDistance(point, distance, true);

[cf. https://github.com/neo4j/neo4j-spatial/blob/master/src/main/java/org/neo4j/gis/spatial/SimplePointLayer.java#L48]

My workaround for this issue was to reimplement the following function in user-space:
List findClosestPoints(SearchPointsWithinOrthodromicDistance)

BR,
Tilman

DynamicLayer.restrictLayerProperties and related methods deleted

I was needing to add features similar to the restrictLayerProperties feature I added a month ago, and found, to my horror, that the code was missing. On a search of the github history, I found that about 30-40 lines of nice code was deleted from DynamicLayer.java on the 7th September by Peter as part of RTree refactoring. The commit is at fa3214b#diff-7

I will see if I can recover the old code, but I am very curious as to why this feature was deleted. Is it possible that someone did the RTree refactoring on an old branch, and merged that into master without first merging from master?

Upload neo4j-spatial on Maven central

In order to use the neo4j-spatial artifacts, the Neo4j Snapshot Maven Repository must be used, because neo4j-spatial is not on Maven central. That introduces additional moving parts, and may not be possible in all environments.

It would make sense to upload the neo4j-spatial to Maven central, along with the other neo4j artifacts. The fact that it's a 0.x version already communicates the fact that it's not a stable/production ready release, so stability should not be a concern here.

Also, I'm guessing this has to be done at some point anyways, so the earlier the better.

Any plans to do this, perhaps in the not too distant future?

test failure (mvn install)

Hi peter,

I get the following failures when running "mvn install" against the current 0.9-SNAPSHOT.
I guess the cause for this problem is not on my side. If so, correct me ;)

Results :

Failed tests:   finding_the_plugin(org.neo4j.gis.spatial.SpatialPluginFunctionalTest): Wrong response status. response: {
  querying_with_cypher(org.neo4j.gis.spatial.SpatialPluginFunctionalTest): Wrong response status. response: {

Tests run: 92, Failures: 2, Errors: 0, Skipped: 0

Here the respective surefire report:

-------------------------------------------------------------------------------
Test set: org.neo4j.gis.spatial.SpatialPluginFunctionalTest
-------------------------------------------------------------------------------
Tests run: 2, Failures: 2, Errors: 0, Skipped: 0, Time elapsed: 6.838 sec <<< FAILURE!
finding_the_plugin(org.neo4j.gis.spatial.SpatialPluginFunctionalTest)  Time elapsed: 1.372 sec  <<< FAILURE!
java.lang.AssertionError: Wrong response status. response: {
  "message" : "No such ServerPlugin: \"SpatialPlugin\"",
  "exception" : "org.neo4j.server.plugins.PluginLookupException: No such ServerPlugin: \"SpatialPlugin\"",
  "stacktrace" : [ "org.neo4j.server.plugins.PluginManager.describeAll(PluginManager.java:149)", "org.neo4j.server.rest.web.ExtensionService.extensionList(ExtensionService.java:292)", "org.neo4j.server.rest.web.ExtensionService.getExtensionList(ExtensionService.java:106)", "sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)", "sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)", "sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)", "java.lang.reflect.Method.invoke(Method.java:616)", "com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)", "com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)", "com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)", "com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:288)", "com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)", "com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)", "com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)", "com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)", "com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1469)", "com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1400)", "com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)", "com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339)", "com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)", "com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537)", "com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:699)", "javax.servlet.http.HttpServlet.service(HttpServlet.java:820)", "org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)", "org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)", "org.neo4j.server.statistic.StatisticFilter.doFilter(StatisticFilter.java:62)", "org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)", "org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)", "org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)", "org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)", "org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)", "org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)", "org.mortbay.jetty.Server.handle(Server.java:326)", "org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)", "org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:926)", "org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)", "org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)", "org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)", "org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)", "org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)" ]
} expected:<200> but was:<404>
    at org.junit.Assert.fail(Assert.java:93)
    at org.junit.Assert.failNotEquals(Assert.java:647)
    at org.junit.Assert.assertEquals(Assert.java:128)
    at org.junit.Assert.assertEquals(Assert.java:472)
    at org.neo4j.server.rest.RESTDocsGenerator.retrieveResponse(RESTDocsGenerator.java:337)
    at org.neo4j.server.rest.RESTDocsGenerator.retrieveResponseFromRequest(RESTDocsGenerator.java:268)
    at org.neo4j.server.rest.RESTDocsGenerator.get(RESTDocsGenerator.java:214)
    at org.neo4j.gis.spatial.SpatialPluginFunctionalTest.finding_the_plugin(SpatialPluginFunctionalTest.java:48)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
    at org.neo4j.test.TestData$1.evaluate(TestData.java:137)
    at org.neo4j.test.TestData$1.evaluate(TestData.java:137)
    at org.junit.rules.RunRules.evaluate(RunRules.java:18)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
    at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123)
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
    at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
    at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:172)
    at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:104)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:70)
querying_with_cypher(org.neo4j.gis.spatial.SpatialPluginFunctionalTest)  Time elapsed: 0.089 sec  <<< FAILURE!
java.lang.AssertionError: Wrong response status. response: {
  "message" : "No such ServerPlugin: \"SpatialPlugin\"",
  "exception" : "org.neo4j.server.plugins.PluginLookupException: No such ServerPlugin: \"SpatialPlugin\"",
  "stacktrace" : [ "org.neo4j.server.plugins.PluginManager.extension(PluginManager.java:123)", "org.neo4j.server.plugins.PluginManager.invoke(PluginManager.java:164)", "org.neo4j.server.rest.web.ExtensionService.invokeGraphDatabaseExtension(ExtensionService.java:299)", "org.neo4j.server.rest.web.ExtensionService.invokeGraphDatabaseExtension(ExtensionService.java:121)", "sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)", "sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)", "sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)", "java.lang.reflect.Method.invoke(Method.java:616)", "com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)", "com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)", "com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)", "com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:288)", "com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)", "com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)", "com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)", "com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)", "com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1469)", "com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1400)", "com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)", "com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339)", "com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)", "com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537)", "com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:699)", "javax.servlet.http.HttpServlet.service(HttpServlet.java:820)", "org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)", "org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)", "org.neo4j.server.statistic.StatisticFilter.doFilter(StatisticFilter.java:62)", "org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)", "org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)", "org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)", "org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)", "org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)", "org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)", "org.mortbay.jetty.Server.handle(Server.java:326)", "org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)", "org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:943)", "org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)", "org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)", "org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)", "org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)", "org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)" ]
} expected:<200> but was:<404>
    at org.junit.Assert.fail(Assert.java:93)
    at org.junit.Assert.failNotEquals(Assert.java:647)
    at org.junit.Assert.assertEquals(Assert.java:128)
    at org.junit.Assert.assertEquals(Assert.java:472)
    at org.neo4j.server.rest.RESTDocsGenerator.retrieveResponse(RESTDocsGenerator.java:337)
    at org.neo4j.server.rest.RESTDocsGenerator.retrieveResponseFromRequest(RESTDocsGenerator.java:298)
    at org.neo4j.server.rest.RESTDocsGenerator.post(RESTDocsGenerator.java:225)
    at org.neo4j.gis.spatial.SpatialPluginFunctionalTest.post(SpatialPluginFunctionalTest.java:74)
    at org.neo4j.gis.spatial.SpatialPluginFunctionalTest.querying_with_cypher(SpatialPluginFunctionalTest.java:60)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
    at org.neo4j.test.TestData$1.evaluate(TestData.java:137)
    at org.neo4j.test.TestData$1.evaluate(TestData.java:137)
    at org.junit.rules.RunRules.evaluate(RunRules.java:18)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
    at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123)
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
    at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
    at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:172)
    at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:104)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:70)

Rgds,
Robert

Build failure

Hi,
I make a git clone of master default branch, after an mvn install, here the log of error :

[INFO] Compiling 129 source files to /home/srey/TRAVAUX/THESE/REPOSITORY_GIT/spatial/target/classes
java.io.FileNotFoundException: META-INF/services/org.neo4j.kernel.KernelExtension
at com.sun.tools.javac.processing.JavacFiler.getResource(JavacFiler.java:464)
at org.neo4j.kernel.impl.annotations.AnnotationProcessor.addTo(AnnotationProcessor.java:148)
at org.neo4j.kernel.impl.annotations.ServiceProcessor.process(ServiceProcessor.java:48)
at org.neo4j.kernel.impl.annotations.AnnotationProcessor.process(AnnotationProcessor.java:72)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:793)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:722)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1700(JavacProcessingEnvironment.java:97)
at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1029)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1163)
at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1106)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:824)
at com.sun.tools.javac.main.Main.compile(Main.java:417)
at com.sun.tools.javac.main.Main.compile(Main.java:331)
at com.sun.tools.javac.main.Main.compile(Main.java:322)
at com.sun.tools.javac.Main.compile(Main.java:94)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.plexus.compiler.javac.JavacCompiler.compileInProcess(JavacCompiler.java:554)
at org.codehaus.plexus.compiler.javac.JavacCompiler.compile(JavacCompiler.java:161)
at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:605)
at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:128)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/srey/TRAVAUX/THESE/REPOSITORY_GIT/spatial/src/main/java/org/neo4j/gis/spatial/indexprovider/SpatialIndexProvider.java:[39,0] error: Internal error: java.io.FileNotFoundException: META-INF/services/org.neo4j.kernel.KernelExtension
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.758s
[INFO] Finished at: Sun Apr 01 17:40:58 CEST 2012
[INFO] Final Memory: 35M/228M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project neo4j-spatial: Compilation failure
[ERROR] /home/srey/TRAVAUX/THESE/REPOSITORY_GIT/spatial/src/main/java/org/neo4j/gis/spatial/indexprovider/SpatialIndexProvider.java:[39,0] error: Internal error: java.io.FileNotFoundException: META-INF/services/org.neo4j.kernel.KernelExtension
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project neo4j-spatial: Compilation failure
/home/srey/TRAVAUX/THESE/REPOSITORY_GIT/spatial/src/main/java/org/neo4j/gis/spatial/indexprovider/SpatialIndexProvider.java:[39,0] error: Internal error: java.io.FileNotFoundException: META-INF/services/org.neo4j.kernel.KernelExtension

at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)

Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation failure
/home/srey/TRAVAUX/THESE/REPOSITORY_GIT/spatial/src/main/java/org/neo4j/gis/spatial/indexprovider/SpatialIndexProvider.java:[39,0] error: Internal error: java.io.FileNotFoundException: META-INF/services/org.neo4j.kernel.KernelExtension

at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:656)
at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:128)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more

[ERROR]
[ERROR]

Add SpatialPlugin#findGeometriesWithinDistance

Currently, there is no way to use Cypher or Gremlin to search the Spatial Index for all geo nodes within a distance. See discussion topic for more details. http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-Using-Webadmin-Console-to-Execute-Spatial-Cypher-Query-tp3500531p3500531.html;cid=1321303030769-259

As a workaround, having this ability via the SpatialPlugin would be beneficial.

I've already taken a shot at adding this capability here -> https://github.com/bm3780/spatial/blob/master/src/main/java/org/neo4j/gis/spatial/server/plugin/SpatialPlugin.java

I've updated the SpatialPluginTests here ->
https://github.com/bm3780/spatial/blob/master/src/test/java/org/neo4j/gis/spatial/ServerPluginTest.java

Bug in SearchClosest

Hi!

I think having detected a bug in SearchClosest, namely the onIndexReference() - method seems not to be correct since it
excludes Geometries which could be nearer than another Geometry.

public final void onIndexReference(Node geomNode) {
Envelope geomEnvelope = getEnvelope(geomNode);
if (searchWindow == null || geomEnvelope.intersects(searchWindow)) {
onEnvelopeIntersection(geomNode, geomEnvelope);
}
}

Problem is that if envelops do not intersect, onEnvelopeIntersection() method is not entered.

I currently play around with neo4j and i occassionally found a case where a geometry which does not intersect with Envelope is the nearer.

In my case I created a very short Linestring, a very long Linestring and a point from which the distance to the small Linestring is shorter than to the long Linestring.

Problem is that the envelope of the short linestring does not intersect with the search window, but the envelope of the long Linestring does and so the long Linestring wins, which is not correct.

The short LineString is "LINESTRING(16.3493032 48.199882,16.3479487 48.1997337)"
The long LineString is "LINESTRING(16.3178388 48.1979135,16.3195494 48.1978011,16.3220815 48.197824,16.3259696 48.1978297,16.3281211 48.1975952,16.3312482 48.1968743,16.3327931 48.1965196,16.3354641 48.1959911,16.3384376 48.1959609,16.3395792 48.1960223,16.3458708 48.1970974,16.3477719 48.1975147,16.348008 48.1975665,16.3505572 48.1984533,16.3535613 48.1994545,16.3559474 48.2011765,16.3567056 48.2025723,16.3571261 48.2038308,16.3578393 48.205176)"
The Point is 16.348243, 48.199678

regards

neo4jgraph

DataSourceName of SpatialIndexProvider is null

Hi,
I was getting this weird exception when I was running a spatial integration test:
Exception in thread "Thread-4" java.lang.NullPointerException
at org.neo4j.kernel.IndexManagerImpl$IndexCreatorThread.run(IndexManagerImpl.java:229)
Investigating it seems that the implementation of SpatialIndexImplementation - getDataSourceName is:
@Override
public String getDataSourceName() {
return null;
}
And, in IndexManagerImpl, when the new IndexCreatorThread is started, this does:
String dataSourceName = getIndexProvider( provider ).getDataSourceName();
XaDataSource dataSource = graphDbImpl.getConfig().getTxModule().getXaDataSourceManager().getXaDataSource( dataSourceName );

So essentially it doesn't find the datasource and fails with a NPE;
I am using neo4j 1.6.1 and neo4j-spatial 0.7 (not SNAPSHOT) and spring-data-neo4j 2.0.1.RELEASE

Home brew installer

In the same fashion as Neo4j.

Perhaps related - the current tests do not run on a Mac OS X Lion 10.7.2 MacBook Pro with 8GB memory (varying errors on different runs).

Spatial index (LayerNodeIndex) cannot be retrieved with IndexManager.forNodes(indexName, customConfiguration)

Obtaining a pre-existing spatial index (LayerNodeIndex) with IndexManager.forNodes(indexName, customConfiguration) throws an IllegalArgumentException.

This is due to SpatialIndexProvider.configMatches(stringStringMap, stringStringMap1) returning false no matter what the parameters.

see https://groups.google.com/forum/#!topic/neo4j/SIxUsF2EExc "neo4j-spatial: Creating a WKT-based index for polygon geometries"

Pull request to follow

docs?

is there something somewhere? I couldn't find anything but the Readme.

thanks

Build failure constructing jars

Hi

I get a build failure (message below) on OSX Mountain Lion using commit 208f841. I have tried building with both Java 1.6 and 1.7. I am using maven 2 from Mac Ports.

Thanks!

[INFO] Building jar: /Users/weber/Desktop/Work/sources/spatial/target/neo4j-spatial-0.9-SNAPSHOT-javadoc.jar
[INFO] [jar:test-jar {execution: attach-test-jar-for-mvn-2}]
[INFO] Building jar: /Users/weber/Desktop/Work/sources/spatial/target/neo4j-spatial-0.9-SNAPSHOT-tests.jar
[INFO] [jar:test-jar {execution: attach-test-jar}]
-----------------------------------------------------
this realm = app0.child-container[org.neo4j.build.plugins:docs-maven-plugin:5]
urls[0] = file:/Users/weber/.m2/repository/org/neo4j/build/plugins/docs-maven-plugin/5/docs-maven-plugin-5.jar
urls[1] = file:/Users/weber/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
urls[2] = file:/Users/weber/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.14/plexus-interpolation-1.14.jar
urls[3] = file:/Users/weber/.m2/repository/org/apache/maven/shared/maven-filtering/1.0/maven-filtering-1.0.jar
urls[4] = file:/Users/weber/.m2/repository/org/sonatype/plexus/plexus-build-api/0.0.4/plexus-build-api-0.0.4.jar
urls[5] = file:/Users/weber/.m2/repository/org/twdata/maven/mojo-executor/2.0/mojo-executor-2.0.jar
urls[6] = file:/Users/weber/.m2/repository/org/codehaus/plexus/plexus-archiver/1.2/plexus-archiver-1.2.jar
urls[7] = file:/Users/weber/.m2/repository/org/codehaus/plexus/plexus-io/1.0.1/plexus-io-1.0.1.jar
Number of imports: 10
import: org.codehaus.classworlds.Entry@a6c57a42
import: org.codehaus.classworlds.Entry@12f43f3b
import: org.codehaus.classworlds.Entry@20025374
import: org.codehaus.classworlds.Entry@f8e44ca4
import: org.codehaus.classworlds.Entry@92758522
import: org.codehaus.classworlds.Entry@ebf2705b
import: org.codehaus.classworlds.Entry@bb25e54
import: org.codehaus.classworlds.Entry@bece5185
import: org.codehaus.classworlds.Entry@3fee8e37
import: org.codehaus.classworlds.Entry@3fee19d8


this realm = plexus.core
urls[0] = file:/opt/local/share/java/maven2/lib/maven-2.2.1-uber.jar
Number of imports: 10
import: org.codehaus.classworlds.Entry@a6c57a42
import: org.codehaus.classworlds.Entry@12f43f3b
import: org.codehaus.classworlds.Entry@20025374
import: org.codehaus.classworlds.Entry@f8e44ca4
import: org.codehaus.classworlds.Entry@92758522
import: org.codehaus.classworlds.Entry@ebf2705b
import: org.codehaus.classworlds.Entry@bb25e54
import: org.codehaus.classworlds.Entry@bece5185
import: org.codehaus.classworlds.Entry@3fee8e37
import: org.codehaus.classworlds.Entry@3fee19d8
-----------------------------------------------------
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Internal error in the plugin manager executing goal 'org.neo4j.build.plugins:docs-maven-plugin:5:assemble': Unable to load the mojo 'org.neo4j.build.plugins:docs-maven-plugin:5:assemble' in the plugin 'org.neo4j.build.plugins:docs-maven-plugin'. A required class is missing: org/codehaus/plexus/util/Scanner
org.codehaus.plexus.util.Scanner
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3 minutes 44 seconds
[INFO] Finished at: Sun Aug 26 15:46:50 SAST 2012
[INFO] Final Memory: 83M/123M
[INFO] ------------------------------------------------------------------------

Neo4j in geoserver doesn't read correctly the test data neostore.id

I'm using this configuration

  • Geoserver V 2.1.1
  • Geotools 2.7.2 (rev 37473)

With plugin neo4j .war into tomcat6 and lib into WEB-INF :

activation-1.1.jar
aopalliance-1.0.jar
avalon-framework-api-4.3.1.jar
avalon-framework-impl-4.3.1.jar
batik-anim-1.7.jar
batik-awt-util-1.7.jar
batik-bridge-1.7.jar
batik-css-1.7.jar
batik-dom-1.7.jar
batik-ext-1.7.jar
batik-gvt-1.7.jar
batik-parser-1.7.jar
batik-script-1.7.jar
batik-svg-dom-1.7.jar
batik-svggen-1.7.jar
batik-transcoder-1.7.jar
batik-util-1.7.jar
batik-xml-1.7.jar
bcmail-jdk14-138.jar
bcprov-jdk14-138.jar
cglib-nodep-2.1_3.jar
common-2.6.0.jar
commons-beanutils-1.7.0.jar
commons-codec-1.2.jar
commons-collections-3.1.jar
commons-dbcp-1.3.jar
commons-digester-1.7.jar
commons-fileupload-1.2.1.jar
commons-httpclient-3.1.jar
commons-io-1.3.2.jar
commons-jxpath-1.3.jar
commons-lang-2.1.jar
commons-logging-1.1.1.jar
commons-pool-1.5.3.jar
commons-validator-1.1.4.jar
com.noelios.restlet-1.0.8.jar
com.noelios.restlet.ext.servlet-1.0.8.jar
com.noelios.restlet.ext.simple-1.0.8.jar
ecore-2.6.1.jar
ehcache-1.6.2.jar
ezmorph-1.0.6.jar
fop-0.94.jar
freemarker-2.3.13.jar
geronimo-jta_1.1_spec-1.1.1.jar
gt-api-2.7.2.jar
gt-arcgrid-2.7.2.jar
gt-coverage-2.7.2.jar
gt-cql-2.7.2.jar
gt-data-2.7.2.jar
gt-epsg-hsql-2.7.2.jar
gt-geotiff-2.7.2.jar
gt-graph-2.7.2.jar
gt-gtopo30-2.7.2.jar
gt-image-2.7.2.jar
gt-imageio-ext-gdal-2.7.2.jar
gt-imagemosaic-2.7.2.jar
gt-jdbc-2.7.2.jar
gt-jdbc-postgis-2.7.2.jar
gt-main-2.7.2.jar
gt-metadata-2.7.2.jar
gt-opengis-2.7.2.jar
gt-property-2.7.2.jar
gt-referencing-2.7.2.jar
gt-render-2.7.2.jar
gt-shapefile-2.7.2.jar
gt-shapefile-renderer-2.7.2.jar
gt-svg-2.7.2.jar
gt-temporal-2.7.2.jar
gt-validation-2.7.2.jar
gt-wfs-2.7.2.jar
gt-wms-2.7.2.jar
gt-xml-2.7.2.jar
gt-xsd-core-2.7.2.jar
gt-xsd-fes-2.7.2.jar
gt-xsd-filter-2.7.2.jar
gt-xsd-gml2-2.7.2.jar
gt-xsd-gml3-2.7.2.jar
gt-xsd-ows-2.7.2.jar
gt-xsd-sld-2.7.2.jar
gt-xsd-wcs-2.7.2.jar
gt-xsd-wfs-2.7.2.jar
gwc-2.1.1.jar
gwc-core-1.2.6.jar
gwc-diskquota-1.2.6.jar
gwc-georss-1.2.6.jar
gwc-gmaps-1.2.6.jar
gwc-kml-1.2.6.jar
gwc-rest-1.2.6.jar
gwc-tms-1.2.6.jar
gwc-ve-1.2.6.jar
gwc-wms-1.2.6.jar
gwc-wmts-1.2.6.jar
h2-1.1.119.jar
hsqldb-1.8.0.7.jar
htmlvalidator-1.2.jar
imageio-ext-arcgrid-1.0.8.jar
imageio-ext-customstreams-1.0.8.jar
imageio-ext-gdalarcbinarygrid-1.0.8.jar
imageio-ext-gdal-bindings-1.4.5b.jar
imageio-ext-gdaldted-1.0.8.jar
imageio-ext-gdalecw-1.0.8.jar
imageio-ext-gdalecwjp2-1.0.8.jar
imageio-ext-gdalehdr-1.0.8.jar
imageio-ext-gdalenvihdr-1.0.8.jar
imageio-ext-gdalerdasimg-1.0.8.jar
imageio-ext-gdalframework-1.0.8.jar
imageio-ext-gdalkakadujp2-1.0.8.jar
imageio-ext-gdalmrsid-1.0.8.jar
imageio-ext-gdalmrsidjp2-1.0.8.jar
imageio-ext-gdalnitf-1.0.8.jar
imageio-ext-geocore-1.0.8.jar
imageio-ext-imagereadmt-1.0.8.jar
imageio-ext-tiff-1.0.8.jar
imageio-ext-utilities-1.0.8.jar
itext-2.1.5.jar
jai_codec-1.1.3.jar
jai_core-1.1.3.jar
jai_imageio-1.1.jar
jdom-1.0.jar
je-4.1.7.jar
jettison-1.0.1.jar
json-lib-2.1-jdk13.jar
json-lib-2.2.3-jdk15.jar
json-simple-1.1.jar
jsr-275-1.0-beta-2.jar
jts-1.11.jar
jt-utils-1.1.1.jar
jt-vectorbinarize-1.1.1.jar
junit-4.8.2.jar
log4j-1.2.14.jar
mail-1.4.jar
main-2.1.1.jar
neo4j-kernel-1.4.jar
neo4j-lucene-index-1.4.jar
neo4j-spatial-0.6-SNAPSHOT.jar
net.opengis.ows-2.7.2.jar
net.opengis.wcs-2.7.2.jar
net.opengis.wfs-2.7.2.jar
org.json-2.0.jar
org.restlet-1.0.8.jar
org.restlet.ext.freemarker-1.0.8.jar
org.restlet.ext.json-1.0.8.jar
org.restlet.ext.spring-1.0.8.jar
org.simpleframework-3.1.3.jar
org.w3.xlink-2.7.2.jar
oro-2.0.8.jar
osm-test-data-20100819.jar
ows-2.1.1.jar
ows-2.1.1-tests.jar
picocontainer-1.2.jar
platform-2.1.1.jar
postgresql-8.4-701.jdbc3.jar
rest-2.1.1.jar
restconfig-2.1.1.jar
servlet-api-2.4.jar
shp-test-data-20100819.jar
slf4j-api-1.5.8.jar
slf4j-log4j12-1.4.2.jar
spring-aop-2.5.5.jar
spring-beans-2.5.5.jar
spring-context-2.5.5.jar
spring-context-support-2.5.5.jar
spring-core-2.5.5.jar
spring-jdbc-2.5.5.jar
spring-security-core-2.0.6.RELEASE.jar
spring-security-core-tiger-2.0.6.RELEASE.jar
spring-support-2.0.8.jar
spring-tx-2.5.5.jar
spring-web-2.5.5.jar
spring-webmvc-2.5.5.jar
stax-1.2.0.jar
stax-api-1.0.1.jar
vecmath-1.3.2.jar
wcs1_0-2.1.1.jar
wcs1_1-2.1.1.jar
wcs-2.1.1.jar
web-core-2.1.1.jar
web-demo-2.1.1.jar
web-gwc-2.1.1.jar
web-security-2.1.1.jar
web-wcs-2.1.1.jar
web-wfs-2.1.1.jar
web-wms-2.1.1.jar
wfs-2.1.1.jar
wicket-1.4.12.jar
wicket-extensions-1.4.12.jar
wicket-ioc-1.4.12.jar
wicket-spring-1.4.12.jar
wms-2.1.1.jar
xalan-2.7.0.jar
xercesImpl-2.6.2.jar
xml-apis-1.3.04.jar
xml-apis-ext-1.3.04.jar
xml-apis-xerces-2.7.1.jar
xmlgraphics-commons-1.2.jar
xpp3-1.1.3.4.O.jar
xpp3_min-1.1.4c.jar
xsd-2.6.0.jar
xstream-1.3.1.jar

Neo4 run into geoserver normaly,
After construction of neo4j test with this command : mvn test -Dtest=TestDynamicLayers
I have this osm layer into neo4j db : 1311178267339 (dl here if you want to test http://dl.dropbox.com/u/3026820/1311178267339.tar.gz )

I'm trying to load neostore.id with this parameter into geoserver neo4j store panel "URL connection parameters" :
file:/home/srey/TRAVAUX/THESE/REPOSITORY_GIT/neo4j-spatial/target/var/neo4j-db/1311178267339/neostore.id

I have this error :
Error creating data store, check the parameters. Error message: Could not acquire data access 'Neo4j-Spatial Test'

So i think this tutorial is outdated : http://wiki.neo4j.org/content/Neo4j_Spatial_in_GeoServer
And i'm really sorry because i can visualize neo4 data with geoserver :-/
Do you have an idea ? How can i resolve this problem ?
Thanks a lot

Enhance Spatial Index testing

make sure this is tested:

curl -X POST http://localhost:7474/db/data/ext/SpatialPlugin/graphdb/addSimplePointLayer -H "Content-Type:application/json" -d '{"layer":"geom", "lat":"lat", "lon":"lon"}'
curl -X POST http://localhost:7474/db/data/node -H "Content-Type:application/json" -H "Accept:application/json" -d '{"lon": 15.2, "lat": 60.1}'
curl -X POST -H "Content-Type:application/json" -d '{"layer":"geom","node":"http://localhost:7474/db/data/node/5"}' http://localhost:7474/db/data/ext/SpatialPlugin/graphdb/addNodeToLayer
curl -X POST -H "Content-Type:application/json" -d '{"layer":"geom","minx":15.0,"maxx":15.3,"miny":60.0,"maxy":60.2}' http://localhost:7474/db/data/ext/SpatialPlugin/graphdb/findGeometriesInLayer

curl -X POST -H "Content-Type:application/json" -d '{"query":"start n = node:geom('bbox:[15.0,15.3,60.0,60.2]') return n"}' http://localhost:7474/db/data/ext/SpatialPlugin/graphdb/CypherPlugin/query

Geospatial queries fail with a NullPointerException if no nodes with spatial indexes have been created

If a neo4j database gets started with no nodes (or no nodes with geospatial properties), and a geospatial query is run against the database, the query will fail with a NullPointerException:

java.lang.NullPointerException
at org.neo4j.gis.spatial.pipes.GeoPipeline.startNearestNeighborLatLonSearch(GeoPipeline.java:363)
at org.neo4j.gis.spatial.indexprovider.LayerNodeIndex.query(LayerNodeIndex.java:249)
at org.neo4j.gis.spatial.indexprovider.LayerNodeIndex.query(LayerNodeIndex.java:291)
at org.neo4j.cypher.internal.executionplan.builders.IndexQueryBuilder$$anonfun$createStartPipe$3.appl
y(IndexQueryBuilder.scala:83)
at org.neo4j.cypher.internal.executionplan.builders.IndexQueryBuilder$$anonfun$createStartPipe$3.appl
y(IndexQueryBuilder.scala:81)
at org.neo4j.cypher.internal.pipes.StartPipe$$anonfun$1.apply(StartPipe.scala:38)
at org.neo4j.cypher.internal.pipes.StartPipe$$anonfun$1.apply(StartPipe.scala:37)
at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:200)
at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:200)
at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
at scala.collection.immutable.List.foreach(List.scala:45)
at scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:200)
at scala.collection.immutable.List.flatMap(List.scala:45)
at org.neo4j.cypher.internal.pipes.StartPipe.createResults(StartPipe.scala:37)
at org.neo4j.cypher.internal.pipes.SlicePipe.createResults(SlicePipe.scala:32)
at org.neo4j.cypher.internal.pipes.ColumnFilterPipe.createResults(ColumnFilterPipe.scala:39)
at org.neo4j.cypher.internal.executionplan.ExecutionPlanImpl$$anonfun$4$$anonfun$apply$2.apply(ExecutionPlanImpl.scala:95)
at org.neo4j.cypher.internal.executionplan.ExecutionPlanImpl$$anonfun$4$$anonfun$apply$2.apply(ExecutionPlanImpl.scala:95)

LayerNodeIndex#add operation should be idempotent

org.neo4j.gis.spatial.indexprovider.LayerNodeIndex#add doesn't seem to conform to the org.neo4j.graphdb.index.Index#add interface specifications:

"Adds a key/value pair for entity to the index. If that key/value pair for the entity is already in the index it's up to the implementation to make it so that such an operation is idempotent."

In my tests, calling LayerNodeIndex#add N number of times for the same Node resulted in N number of nodes being added to the corresponding Spatial Layer for that index.

geoserver plugin installation issue

I can't get the neo4j-geoserver plugin to work (GeoServer 2.1.4, MacOS) when I follow the instructions on the main page, GeoServer starts up, and in the console are errors (errors pasted below). The only way I got this to work is to copy the neo4j lib contents (from the downloaded distribution) into GeoServer WEB-INF/lib, then copy ONLY the neo4j-spatial-0.9-SNAPSHOT.jar into GeoServer WEB-INF/lib. So maybe this is just a documentation issue?

-- in the geoserver UI console after starting:

  • GEOSERVER_DATA_DIR: /Applications/GeoServer.app/Contents/Resources/Java/data_dir
    Loaded style 'burg'
    Loaded style 'capitals'
    Loaded style 'cite_lakes'
    Loaded style 'dem'
    Loaded style 'giant_polygon'
    Loaded style 'grass'
    Loaded style 'green'
    Loaded style 'line'
    Loaded style 'poi'
    Loaded style 'point'
    Loaded style 'poly_landmarks'
    Loaded style 'polygon'
    Loaded style 'pophatch'
    Loaded style 'population'
    Loaded style 'rain'
    Loaded style 'raster'
    Loaded style 'restricted'
    Loaded style 'simple_roads'
    Loaded style 'simple_streams'
    Loaded style 'tiger_roads'
    Loaded default workspace cite
    Loaded workspace 'cite'
    Loaded workspace 'it.geosolutions'
    Loaded workspace 'nurc'
    Loaded workspace 'sde'
    Loaded workspace 'sf'
    Loaded workspace 'tiger'
    Loaded workspace 'topp'
    Loaded store 'arcGridSample', enabled
    Loaded coverage store 'arcGridSample'
    Invocation of destroy method failed on bean with name 'geoServerLoader': java.lang.NullPointerException
    Context initialization failed

When I visit http://localhost:8080/geoserver/web, I get:

HTTP ERROR: 503

SERVICE_UNAVAILABLE
RequestURI=/geoserver/web

Somehow neo4j spatial is creating invalid relationships between its data nodes

The following exception occured when I was trying to update a node with spatial data:

org.neo4j.graphdb.NotFoundException: More than one relationship[RTREE_REFERENCE, INCOMING] found for NodeImpl#14271

This is using neo4j-spatial v0.8 with neo4j 1.7.

Node 14271 has these properties:

id: 14270
bbox: [-112.36,33.45,-112.36,33.45]
wkt: "POINT (-112.36 33.45)"
gtype: 1

It had two incoming RTREE_REFERENCE relationships to nodes with the bbox property:

bbox: [-112.36,33.45,-112.07,33.45]

The other one I deleted, so that the app would work properly, but it had a bbox value slightly different, but one that would enclose the point in node 14271.

I don't have a test that will reproduce this, and I frankly have no idea how it happened. I could NOT reproduce this on my own after I deleted the second relationship.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.