public ActionResult Index(GeometriesViewModel model) { //potrebno za punjenje modela var manager = new PgSqlManager(); var buildings = manager.GetData(TableToChoose.Buildings).Take(_limit).ToList(); //DAKLE IZ SELECTANIH STVARI (IZ DROPDOWN LISTA...SelectedRoadId SelectedBuildingId nadjemo sta trebamo i to prosljedjujemo u manager funkcije za racunanje distance i te linije koja je najkraca... liniju dobivamo kao NpgSqlGeometriju i kao string u obliku LINESTRING(long lat, long lat, itd il kako vec) var geom2 = buildings.Find(m => m.Id == model.SelectedBuildingId).GeometryAsText; var shortestDistance = manager.CalculateShortestDistance(geom2); var shortestLine_Geometry = manager.GetShortestLine(geom2).Item1; var shortestLine_GeometryAsText = manager.GetShortestLine(geom2).Item2; var road = manager.GetRoad(geom2); var length = manager.CalculateLength(geom2); //Pocetne i krajnje tocke tog najkraceg puta mozda treba na frontu model.startX = shortestLine_Geometry[0].X; model.startY = shortestLine_Geometry[0].Y; model.endX = shortestLine_Geometry[1].X; model.endY = shortestLine_Geometry[1].Y; //punjenje modela i vracanje u view model.Buildings = buildings; model.Distance = shortestDistance; model.ShortestLine_Geometry = shortestLine_Geometry; model.ShortestLine_GeometryAsText = shortestLine_GeometryAsText; model.Length = length; model.enter = ""; model.name = null; model.myWkt = geom2; model.road = road; ViewBag.fail = "Unesite WKT"; return(View(model)); }