Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
runeanielsen opened this issue Oct 7, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@runeanielsen
Copy link
Member

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);

@runeanielsen runeanielsen added the enhancement New feature or request label Oct 7, 2020
@runeanielsen runeanielsen self-assigned this Oct 7, 2020
@runeanielsen runeanielsen changed the title Optimize the snap to roite Optimize the snap to route node on Digitized and Connectivity changed commands Oct 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant