Neo4j Spatial in GeoServer

Neo4j Spatial provides built-in support for GeoTools data store, making it directly usable inside GeoServer for publishing and visualizing spatial data.

Prerequisites

  • GeoServer (download from http://geoserver.org)

  • Neo4j database with Neo4j Spatial plugin

  • Neo4j Spatial layers configured in your database

Installation and Setup

Building the Plugin

mvn clean package

Deployment

  1. Copy the neo4j-spatial-geotools-plugin-xxx-SNAPSHOT-with-dependencies.jar from:

    into $GEOSERVER_HOME/webapps/geoserver/WEB-INF/lib

  2. Restart GeoServer

  3. Open the GeoServer admin interface at http://localhost:8080/geoserver/web/

Configuration

Create Workspace

  1. Login to GeoServer (default: admin/geoserver)

  2. Create a new workspace for your Neo4j data

Add Data Source

  1. Go to 'Stores' → 'Add new Store'

    Geoserver 1 logged in
  2. Select 'Neo4j' under Vector Data Sources

    Geoserver 2 add new store
  3. Configure the Neo4j connection:

    Geoserver 3 configure store
    • Database URI: Connection string to your Neo4j database

    • Username/Password: Neo4j credentials

Publish Layers

  1. Go to 'Layers' → 'Add new layer'

  2. Choose your Neo4j datastore

  3. Select a layer by clicking 'Publish'

    Geoserver 4 publish layer
  4. Configure layer settings:

    • Click 'Compute from data' for a native bounding box

    • Click 'Compute from native bounds' for a Lat/Lon bounding box

  5. Save the layer

Usage

Preview Layers

  • Single layer: Go to 'Layer Preview' → select layer → 'OpenLayers'

Development Testing

For testing with GeoServer source code:

  1. Check out GeoServer source

  2. Add Neo4j profile to src/web/app/pom.xml:

    <profile>
      <id>neo4j</id>
      <dependencies>
        <dependency>
          <groupId>org.neo4j</groupId>
          <artifactId>neo4j-spatial-geotools-plugin</artifactId>
          <version>2025.10.0</version>
        </dependency>
      </dependencies>
    </profile>
  3. Run with profile:

    cd src/web/app
    mvn jetty:run -Pneo4j