コード例 #1
0
 public ActionResult GetAllKoordinierteMassnahmenAt(double x, double y, double tolerance)
 {
     try
     {
         IEnumerable <KoordinierteMassnahmeGIS> koordinierteMassnahmen = koordinierteMassnahmeGISModelService.GetAllKoordinierteMassnahmenAt(x, y, tolerance);
         return(Content(geoJSONParseService.GenereateGeoJsonStringfromEntities(koordinierteMassnahmen), "application/json"));
     }
     catch (Exception exc)
     {
         return(Content(GeoJSONStrings.GeoJSONFailure(exc.Message), "application/json"));
     }
 }
コード例 #2
0
 public ActionResult GetRealisierteMassnahmeByID(string id)
 {
     try
     {
         RealisierteMassnahmeGISModel realisierteMassnahme = realisierteMassnahmeGISModelService.GetById(Guid.Parse(id));
         return(Content(realisierteMassnahme.FeatureGeoJSONString, "application/json"));
     }
     catch (Exception exc)
     {
         return(Content(GeoJSONStrings.GeoJSONFailure(exc.Message), "application/json"));
     }
 }
コード例 #3
0
 public ActionResult GetKoordinierteMassnahmeAt(double x, double y, double tolerance)
 {
     try
     {
         KoordinierteMassnahmeGISModel koordinierteMassnahme = koordinierteMassnahmeGISModelService.GetKoordinierteMassnahmeAt(x, y, tolerance);
         return(Content(koordinierteMassnahme.FeatureGeoJSONString, "application/json"));
     }
     catch (Exception exc)
     {
         return(Content(GeoJSONStrings.GeoJSONFailure(exc.Message), "application/json"));
     }
 }
コード例 #4
0
 public ActionResult GetStrassenabschnitteFromInspektionsroute(Guid id)
 {
     if (id != Guid.Empty)
     {
         string geoJSONstring = inspektionsRouteGISService.GetStrassenabschnitteFromInspektionsroute(id);
         return(Content(geoJSONstring, "application/json"));
     }
     else
     {
         return(Content(GeoJSONStrings.GeoJSONFailure("Empty ID!"), "application/json"));
     }
 }
コード例 #5
0
 public ActionResult GetInspektionsRouteGISAt(double x, double y, double tolerance)
 {
     try
     {
         InspektionsRouteGISModel inspektionsRoute = inspektionsRouteGISService.GetInspektionsRouteGISAt(x, y, tolerance);
         return(Content(inspektionsRoute.FeatureGeoJSONString, "application/json"));
     }
     catch (Exception exc)
     {
         return(Content(GeoJSONStrings.GeoJSONFailure(exc.Message), "application/json"));
     }
 }
 public ActionResult GetMassnahmenvorschlagTeilsystemeGISByID(string id)
 {
     try
     {
         MassnahmenvorschlagTeilsystemeGISModel massnahmenvorschlagTeilsystemeGIS = massnahmenvorschlagTeilsystemeGISModelService.GetById(Guid.Parse(id));
         return(Content(massnahmenvorschlagTeilsystemeGIS.FeatureGeoJSONString, "application/json"));
     }
     catch (Exception exc)
     {
         return(Content(GeoJSONStrings.GeoJSONFailure(exc.Message), "application/json"));
     }
 }
 public ActionResult GetAllMassnahmenvorschlagTeilsystemeGISAt(double x, double y, double tolerance)
 {
     try
     {
         IList <MassnahmenvorschlagTeilsystemeGIS> massnahmenvorschlagTeilsystemeGIS = massnahmenvorschlagTeilsystemeGISModelService.GetAllKoordinierteMassnahmenAt(x, y, tolerance);
         return(Content(geoJSONParseService.GenereateGeoJsonStringfromEntities(massnahmenvorschlagTeilsystemeGIS), "application/json"));
     }
     catch (Exception exc)
     {
         return(Content(GeoJSONStrings.GeoJSONFailure(exc.Message), "application/json"));
     }
 }
 public ActionResult GetMassnahmenvorschlagTeilsystemeGISAt(double x, double y, double tolerance)
 {
     try
     {
         MassnahmenvorschlagTeilsystemeGISModel massnahmenvorschlagTeilsystemeGIS = massnahmenvorschlagTeilsystemeGISModelService.GetKoordinierteMassnahmeAt(x, y, tolerance);
         return(Content(massnahmenvorschlagTeilsystemeGIS.FeatureGeoJSONString, "application/json"));
     }
     catch (Exception exc)
     {
         return(Content(GeoJSONStrings.GeoJSONFailure(exc.Message), "application/json"));
     }
 }
コード例 #9
0
 public ActionResult GetStrassenabschnittByID(string id)
 {
     try
     {
         StrassenabschnittGISModel strassenabschnitt = strassenabschnittGISService.GetById(Guid.Parse(id));
         return(Content(strassenabschnitt.FeatureGeoJSONString, "application/json"));
     }
     catch (Exception exc)
     {
         return(Content(GeoJSONStrings.GeoJSONFailure(exc.Message), "application/json"));
     }
 }
コード例 #10
0
 public ActionResult GetStrassenabschnittAt(double x, double y, double tolerance)
 {
     try
     {
         StrassenabschnittGISModel strassenabschnitt = strassenabschnittGISService.GetCurrentStrassenabschnittAt(x, y, tolerance);
         return(Content(strassenabschnitt.FeatureGeoJSONString, "application/json"));
     }
     catch (Exception exc)
     {
         return(Content(GeoJSONStrings.GeoJSONFailure(exc.Message), "application/json"));
     }
 }
コード例 #11
0
 public ActionResult GetAxisAt(double?x, double?y, double tolerance)
 {
     if (x == null && y == null)
     {
         return(Content(GeoJSONStrings.GeoJSONFailure("Keine Koordinaten angegeben"), "application/json"));
     }
     else
     {
         try
         {
             return(Content(achsensegmentService.GetNearestAchsenSegment((double)x, (double)y, tolerance), "application/json"));
         }
         catch (Exception exc)
         {
             return(Content(GeoJSONStrings.GeoJSONFailure(exc.Message), "application/json"));
         }
     }
 }
コード例 #12
0
 public ActionResult GetAvailableInspektionsRouteGISAt(double x, double y, double tolerance)
 {
     try
     {
         InspektionsRouteGISModel inspektionsRoute = inspektionsRouteGISService.GetInspektionsRouteGISAt(x, y, tolerance);
         var inspektionsRouteGISOverviewModel      = inspektionsRouteGISOverviewService.GetById(inspektionsRoute.Id);
         if (inspektionsRouteGISOverviewModel.Status != Business.Entities.GIS.InspektionsRouteStatus.RouteExportiert)
         {
             return(Content(inspektionsRoute.FeatureGeoJSONString, "application/json"));
         }
         else
         {
             return(Content(GeoJSONStrings.GeoJSONFailure(String.Format(@"Inspektionsroute: {0} {1},  is already exported", inspektionsRoute.Id, inspektionsRoute.Bezeichnung)), "application/json"));
         }
     }
     catch (Exception exc)
     {
         return(Content(GeoJSONStrings.GeoJSONFailure(exc.Message), "application/json"));
     }
 }
コード例 #13
0
        public ActionResult GetStrassenabschnittByBbox(double minX, double minY, double maxX, double maxY)
        {
            try
            {
                Coordinate bottomLeft  = new Coordinate(minX, minY);
                Coordinate topRight    = new Coordinate(maxX, maxY);
                Coordinate bottomRight = new Coordinate(maxX, minY);
                Coordinate topLeft     = new Coordinate(minX, maxY);

                ILinearRing linearRing = new LinearRing(new Coordinate[] { topLeft, topRight, bottomRight, bottomLeft, topLeft });

                IGeometry filterGeom = new NetTopologySuite.Geometries.Polygon(linearRing, GISService.CreateGeometryFactory());

                IList <StrassenabschnittGIS> strassenabschnitte = strassenabschnittGISService.GetCurrentBySpatialFilter(filterGeom);

                strassenabschnitte = strassenabschnitte.Where(s => s.Shape.Intersects(filterGeom)).ToList();
                return(Content(geoJSONParseService.GenereateGeoJsonStringfromEntities(strassenabschnitte), "application/json"));
            }
            catch (Exception exc)
            {
                return(Content(GeoJSONStrings.GeoJSONFailure(exc.Message), "application/json"));
            }
        }
コード例 #14
0
 public ActionResult SplitStrassenabschnittAt(Guid strassenabschnitId, string x, string y)
 {
     strassenabschnittGISService.SplitStrassenabschnittGISAtXY(strassenabschnitId, x, y);
     return(Content(GeoJSONStrings.GeoJSONSuccess("success"), "application/json"));
 }