Added /getClosestNode lat lon API
This commit is contained in:
parent
f266c6c7e6
commit
9c53c67763
@ -1,4 +1,5 @@
|
||||
using OSMDatastructure.Graph;
|
||||
using OSMImporter;
|
||||
using Pathfinding;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
@ -22,6 +23,12 @@ app.MapGet("/getRoute", (float latStart, float lonStart, float latEnd, float lon
|
||||
}
|
||||
);
|
||||
|
||||
app.MapGet("/getClosestNode", (float lat, float lon) =>
|
||||
{
|
||||
RegionManager regionManager = new RegionManager("D:/stuttgart-regbez-latest");
|
||||
return Pathfinder.ClosestNodeToCoordinates(new Coordinates(lat, lon), Tag.SpeedType.car, ref regionManager);
|
||||
});
|
||||
|
||||
// Configure the HTTP request pipeline.
|
||||
if (app.Environment.IsDevelopment())
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user