Skip to content

Conversation

@Andy2003
Copy link
Collaborator

@Andy2003 Andy2003 commented Nov 21, 2025

Pull Request Overview

This PR refactors layer type registration by introducing a LayerTypePresets interface and ServiceLoader-based discovery mechanism to centralize and streamline configuration management. The hardcoded layer type registrations in SpatialDatabaseService are extracted into separate preset classes that can be discovered and loaded dynamically.

  • Introduced LayerTypePresets interface with RegisteredLayerType record to define layer type configurations
  • Migrated layer type registrations from static initialization to ServiceLoader-based discovery
  • Split layer type definitions into SpatialLayerTypePresets (general types) and OsmSpatialLayerTypePresets (OSM-specific)

…ze and streamline configuration management.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors layer type registration by introducing a LayerTypePresets interface and ServiceLoader-based discovery mechanism to centralize and streamline configuration management. The hardcoded layer type registrations in SpatialDatabaseService are extracted into separate preset classes that can be discovered and loaded dynamically.

  • Introduced LayerTypePresets interface with RegisteredLayerType record to define layer type configurations
  • Migrated layer type registrations from static initialization to ServiceLoader-based discovery
  • Split layer type definitions into SpatialLayerTypePresets (general types) and OsmSpatialLayerTypePresets (OSM-specific)

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
api/src/main/java/org/neo4j/spatial/api/layer/LayerTypePresets.java Defines the new LayerTypePresets interface and RegisteredLayerType record for layer type configuration
server-plugin/src/main/resources/META-INF/services/org.neo4j.spatial.api.layer.LayerTypePresets ServiceLoader configuration file listing the preset implementations
server-plugin/src/main/java/org/neo4j/gis/spatial/SpatialLayerTypePresets.java Implementation providing general spatial layer type presets (SimplePoint, WKT, WKB, etc.)
server-plugin/src/main/java/org/neo4j/gis/spatial/OsmSpatialLayerTypePresets.java Implementation providing OSM-specific layer type preset
server-plugin/src/main/java/org/neo4j/gis/spatial/SpatialDatabaseService.java Refactored to use ServiceLoader for loading presets, removed hardcoded registrations and inner RegisteredLayerType class

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link

Test Results

 34 files  ±0   34 suites  ±0   17m 10s ⏱️ +11s
361 tests ±0  336 ✅ ±0  25 💤 ±0  0 ❌ ±0 
340 runs  ±0  315 ✅ ±0  25 💤 ±0  0 ❌ ±0 

Results for commit 4b70410. ± Comparison against base commit 8097cce.

@Andy2003 Andy2003 merged commit f69aca6 into master Nov 21, 2025
2 checks passed
@Andy2003 Andy2003 deleted the feature/layer-type-presets branch November 21, 2025 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants