Skip to content

Optimize the snap to route node on Digitized and Connectivity changed commands #14

@runeanielsen

Description

@runeanielsen

The following code should only snap if they're further away than a configured tolerance. This is needed because it is a very heavy operation to modify the geometry in the database, resulting in a 10x performance decrease.

The places that need to be fixed are marked below.

var lineString = request.After.GetLineString();
lineString.Coordinates[0] = new Coordinate(startNode.GetPoint().Coordinate);
request.After.Coord = lineString.AsBinary();
await _geoDatabase.UpdateRouteSegment(request.After);

var lineString = request.After.GetLineString();
lineString.Coordinates[lineString.Coordinates.Count() - 1] = new Coordinate(endNode.GetPoint().Coordinate);
request.After.Coord = lineString.AsBinary();
await _geoDatabase.UpdateRouteSegment(request.After);

var lineString = routeSegment.GetLineString();
lineString.Coordinates[0] = new Coordinate(startNode.GetPoint().Coordinate);
routeSegment.Coord = lineString.AsBinary();
await _geoDatabase.UpdateRouteSegment(routeSegment);

var lineString = routeSegment.GetLineString();
lineString.Coordinates[lineString.Coordinates.Count() - 1] = new Coordinate(endNode.GetPoint().Coordinate);
routeSegment.Coord = lineString.AsBinary();
await _geoDatabase.UpdateRouteSegment(routeSegment);

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions