System Components
AlphaShape API Endpoint
REST endpoint that returns alpha shape boundary data for a specific RoadNet. Takes a RoadNet ID and alpha parameter as input.
The endpoint returns an AlphaShapeReply
containing the collection of polygon
coordinates. The alpha parameter controls boundary tightness - lower values
create more detailed, tighter boundaries while higher values create simpler,
looser boundaries.
The native DCC core performs the actual alpha shape calculation using the provided alpha parameter. For details on the alpha shape algorithm, see Alpha Shape Algorithm Documentation.
AlphaShapeCache
Thread-safe in-memory storage for alpha shape polygons that maintains data
sorted by total area (smallest to largest). This ordering optimization allows
the RoadNetIdCalculator
to check smaller, more specific RoadNets first during
coordinate matching.
Notice that the cache is not used by the AlphaShape API endpoint. Instead, the
cache is exclusively used for automatic RoadNet selection processes. The
PeriodicAlphaShapeService
populates the cache only with the default
alpha-value configured for the individual roadnet with the AlphaValueDefault
setting.
PeriodicAlphaShapeService
Background service that follows a two-phase lifecycle to ensure the alpha shape cache remains populated:
Initialization Phase
- Startup Delay: Waits 10 seconds for the API to fully start
- Gap Analysis: Identifies which RoadNets don't have cached alpha shapes
- Parallel Population: Requests alpha shapes for uncached RoadNets with a 1 minute timeout.
- Retry Logic: Retries failed requests up to 5 times
Periodic Refresh Phase
Runs every 24 hours to refresh all cached alpha shapes, using 10-minute timeouts per request and continuing even if individual requests fail.
RoadNetIdCalculator
Determines which RoadNet contains given coordinates.
Algorithm Steps
- Validation: Ensures the request implements
IKnownRequestWithCoordinates
and the cache is populated - Coordinate Extraction: Extracts all coordinates from the request
- RoadNet Iteration: Iterates through cached RoadNets ordered by area (smallest first)
- Containment Testing: For each RoadNet, tests if all coordinates fall within the alpha shape polygons
By checking smaller RoadNets first, requests are directed to servers that handle faster-processing RoadNets.