Exemple #1
0
        public virtual void UpdateModel(Models.TreatmentBMP treatmentBMP, Person currentPerson)
        {
            // note that these nullables will never be null due to the Required attribute
            // this is coming FROM the browser, so it has to be reprojected to CA State Plane
            var locationPoint4326 = DbSpatialHelper.MakeDbGeometryFromCoordinates(TreatmentBMPPointX.GetValueOrDefault(),
                                                                                  TreatmentBMPPointY.GetValueOrDefault(), CoordinateSystemHelper.WGS_1984_SRID);
            var locationPoint = CoordinateSystemHelper.ProjectWebMercatorToCaliforniaStatePlaneVI(locationPoint4326);

            treatmentBMP.LocationPoint     = locationPoint;
            treatmentBMP.LocationPoint4326 = locationPoint4326;

            treatmentBMP.UpdateUpstreamBMPReferencesIfNecessary();

            // associate watershed, lspc basin, precipitation zone
            treatmentBMP.SetTreatmentBMPPointInPolygonDataByLocationPoint(locationPoint);

            treatmentBMP.UpdatedCentralizedBMPDelineationIfPresent();
        }