Esempio n. 1
0
        public IList <Feature> writeStrabs(IList <StrassenabschnittGIS> strabs)
        {
            IList <Feature> features = new List <Feature>();

            foreach (StrassenabschnittGIS strab in strabs)
            {
                //The service uses a cache (httpRequestCacheService) for loading  WiederbeschaffungswertKatalogModels so there should be no performance problem looking this up for every strab
                WiederbeschaffungswertKatalogModel wbwkatalog = this.wiederbeschaffungswertKatalogService.GetWiederbeschaffungswertKatalogModel(strab.Belastungskategorie);

                Feature          feature    = new Feature();
                IAttributesTable attributes = new AttributesTable();

                feature.Geometry = strab.Shape;

                double areaTrottLeft  = strab.BreiteTrottoirLinks != null ? (double)(strab.BreiteTrottoirLinks * strab.Laenge) : 0d;
                double areaTrottRight = strab.BreiteTrottoirRechts != null ? (double)(strab.BreiteTrottoirRechts * strab.Laenge) : 0d;
                double areaStreet     = (double)(strab.Laenge * strab.BreiteFahrbahn);
                double wbw            = areaStreet * (double)wbwkatalog.FlaecheFahrbahn + (double)wbwkatalog.FlaecheTrottoir * (areaTrottLeft + areaTrottRight);

                attributes.AddAttribute(StrabShapeFileConstants.ID, this.guidToOracleRaw(strab.Id));
                attributes.AddAttribute(StrabShapeFileConstants.Belastungskategorie, StrabShapeFileConstants.getBelastungsKategorie(strab.Belastungskategorie.Typ));
                attributes.AddAttribute(StrabShapeFileConstants.Laenge, (double)strab.Laenge);
                attributes.AddAttribute(StrabShapeFileConstants.FlaecheFahrbahn, areaStreet);
                attributes.AddAttribute(StrabShapeFileConstants.Bezeichnungbis, strab.BezeichnungBis != null ? strab.BezeichnungBis : string.Empty);
                attributes.AddAttribute(StrabShapeFileConstants.Bezeichnungvon, strab.BezeichnungVon != null ? strab.BezeichnungVon : string.Empty);
                attributes.AddAttribute(StrabShapeFileConstants.Strassenname, strab.Strassenname != null ? strab.Strassenname : string.Empty);
                attributes.AddAttribute(StrabShapeFileConstants.Eigentuemer, StrabShapeFileConstants.getOwner(strab.Strasseneigentuemer));
                attributes.AddAttribute(StrabShapeFileConstants.Ortsbezeichnung, strab.Ortsbezeichnung != null ? strab.Ortsbezeichnung : string.Empty);
                attributes.AddAttribute(StrabShapeFileConstants.Belag, StrabShapeFileConstants.getBelag(strab.Belag));
                attributes.AddAttribute(StrabShapeFileConstants.BreiteFahrbahn, (double)strab.BreiteFahrbahn);
                attributes.AddAttribute(StrabShapeFileConstants.Trottoir, StrabShapeFileConstants.getTrottoirTyp(strab.Trottoir));
                attributes.AddAttribute(StrabShapeFileConstants.BreiteTrottoirlinks, strab.BreiteTrottoirLinks != null ? (double)strab.BreiteTrottoirLinks : 0d);
                attributes.AddAttribute(StrabShapeFileConstants.FlaecheTrottoirlinks, areaTrottLeft);
                attributes.AddAttribute(StrabShapeFileConstants.BreiteTrottoirrechts, strab.BreiteTrottoirRechts != null ? (double)strab.BreiteTrottoirRechts : 0d);
                attributes.AddAttribute(StrabShapeFileConstants.FlaecheTrottoirrechts, areaTrottRight);
                attributes.AddAttribute(StrabShapeFileConstants.FlaecheTrottoir, areaTrottRight + areaTrottLeft);
                attributes.AddAttribute(StrabShapeFileConstants.Wiederbeschaffungswert, wbw);
                attributes.AddAttribute(StrabShapeFileConstants.AlterungsbeiwertI, (double)wbwkatalog.AlterungsbeiwertI);
                attributes.AddAttribute(StrabShapeFileConstants.WertverlustI, (double)((double)wbwkatalog.AlterungsbeiwertI * wbw / 100));
                attributes.AddAttribute(StrabShapeFileConstants.AlterungsbeiwertII, (double)wbwkatalog.AlterungsbeiwertII);
                attributes.AddAttribute(StrabShapeFileConstants.WertverlustII, (double)((double)wbwkatalog.AlterungsbeiwertII * wbw / 100));

                feature.Attributes = attributes;
                features.Add(feature);
            }
            return(features);
            //shpShxSerializeService.WriteShpShxDbf(features, fileName);
        }
Esempio n. 2
0
        private IAttributesTable writeBaseTroittoir(IAttributesTable attributes, ZustandsabschnittGIS zab)
        {
            attributes.AddAttribute(TrottoirShapeFileConstants.StrassenabschnittID, this.guidToOracleRaw(zab.StrassenabschnittGIS.Id));
            attributes.AddAttribute(TrottoirShapeFileConstants.Strassenname, zab.StrassenabschnittGIS.Strassenname);
            attributes.AddAttribute(TrottoirShapeFileConstants.StrassenabschnittBezeichnungvon, zab.StrassenabschnittGIS.BezeichnungVon != null ? zab.StrassenabschnittGIS.BezeichnungVon : string.Empty);
            attributes.AddAttribute(TrottoirShapeFileConstants.StrassenabschnittBezeichnungbis, zab.StrassenabschnittGIS.BezeichnungBis != null ? zab.StrassenabschnittGIS.BezeichnungBis : string.Empty);
            attributes.AddAttribute(TrottoirShapeFileConstants.Eigentuemer, StrabShapeFileConstants.getOwner(zab.StrassenabschnittGIS.Strasseneigentuemer));
            attributes.AddAttribute(TrottoirShapeFileConstants.Ortsbezeichnung, zab.StrassenabschnittGIS.Ortsbezeichnung != null ? zab.StrassenabschnittGIS.Ortsbezeichnung : string.Empty);

            attributes.AddAttribute(TrottoirShapeFileConstants.ID, this.guidToOracleRaw(Guid.NewGuid()));
            attributes.AddAttribute(TrottoirShapeFileConstants.ZustandsAbschnittID, this.guidToOracleRaw(zab.Id));
            attributes.AddAttribute(TrottoirShapeFileConstants.Bezeichnungvon, zab.BezeichnungVon != null ? zab.BezeichnungVon : string.Empty);
            attributes.AddAttribute(TrottoirShapeFileConstants.Bezeichnungbis, zab.BezeichnungBis != null ? zab.BezeichnungBis : string.Empty);
            attributes.AddAttribute(TrottoirShapeFileConstants.Laenge, (double)zab.Laenge);
            attributes.AddAttribute(TrottoirShapeFileConstants.Aufnahmedatum, zab.Aufnahmedatum);
            attributes.AddAttribute(TrottoirShapeFileConstants.Aufnahmeteam, zab.Aufnahmeteam != null ? zab.Aufnahmeteam : string.Empty);
            return(attributes);
        }
Esempio n. 3
0
        public IList <Feature> writeZabs(IList <ZustandsabschnittGIS> zabs)
        {
            IList <Feature> features = new List <Feature>();

            foreach (ZustandsabschnittGIS zab in zabs)
            {
                Feature          feature    = new Feature();
                IAttributesTable attributes = new AttributesTable();

                feature.Geometry = zab.Shape;


                double areafb  = (double)(zab.FlaecheFahrbahn != null ? zab.FlaecheFahrbahn : 0m);
                double areatrl = (double)(zab.FlaceheTrottoirLinks != null ? zab.FlaceheTrottoirLinks : 0m);
                double areatrr = (double)(zab.FlaceheTrottoirRechts != null ? zab.FlaceheTrottoirRechts : 0m);

                double fbkosten = (double)(zab.KostenMassnahmenvorschlagFahrbahn == null
                    ? (zab.MassnahmenvorschlagFahrbahn != null ? zab.MassnahmenvorschlagFahrbahn.DefaultKosten : 0m)
                    : zab.KostenMassnahmenvorschlagFahrbahn);
                double trrkosten = (double)(zab.KostenMassnahmenvorschlagTrottoirRechts == null
                    ? (zab.MassnahmenvorschlagTrottoirRechts != null ? zab.MassnahmenvorschlagTrottoirRechts.DefaultKosten : 0m)
                    : zab.KostenMassnahmenvorschlagTrottoirRechts);
                double trlkosten = (double)(zab.KostenMassnahmenvorschlagTrottoirLinks == null
                    ? (zab.MassnahmenvorschlagTrottoirLinks != null ? zab.MassnahmenvorschlagTrottoirLinks.DefaultKosten : 0m)
                    : zab.KostenMassnahmenvorschlagTrottoirLinks);

                attributes.AddAttribute(ZabShapeFileConstants.StrassenabschnittID, this.guidToOracleRaw(zab.StrassenabschnittGIS.Id));
                attributes.AddAttribute(ZabShapeFileConstants.Strassenname, zab.StrassenabschnittGIS.Strassenname);
                attributes.AddAttribute(ZabShapeFileConstants.StrassenabschnittBezeichnungvon, zab.StrassenabschnittGIS.BezeichnungVon != null ? zab.StrassenabschnittGIS.BezeichnungVon : string.Empty);
                attributes.AddAttribute(ZabShapeFileConstants.StrassenabschnittBezeichnungbis, zab.StrassenabschnittGIS.BezeichnungBis != null ? zab.StrassenabschnittGIS.BezeichnungBis : string.Empty);
                attributes.AddAttribute(ZabShapeFileConstants.Eigentuemer, StrabShapeFileConstants.getOwner(zab.StrassenabschnittGIS.Strasseneigentuemer));
                attributes.AddAttribute(ZabShapeFileConstants.Ortsbezeichnung, zab.StrassenabschnittGIS.Ortsbezeichnung != null ? zab.StrassenabschnittGIS.Ortsbezeichnung : string.Empty);

                attributes.AddAttribute(ZabShapeFileConstants.ID, this.guidToOracleRaw(zab.Id));
                attributes.AddAttribute(ZabShapeFileConstants.Bezeichnungvon, zab.BezeichnungVon != null ? zab.BezeichnungVon : string.Empty);
                attributes.AddAttribute(ZabShapeFileConstants.Bezeichnungbis, zab.BezeichnungBis != null ? zab.BezeichnungBis : string.Empty);
                attributes.AddAttribute(ZabShapeFileConstants.Laenge, (double)zab.Laenge);
                attributes.AddAttribute(ZabShapeFileConstants.FlaecheFahrbahn, areafb);
                attributes.AddAttribute(ZabShapeFileConstants.FlaecheTrottoirlinks, areatrl);
                attributes.AddAttribute(ZabShapeFileConstants.FlaecheTrottoirrechts, areatrr);
                attributes.AddAttribute(ZabShapeFileConstants.Aufnahmedatum, zab.Aufnahmedatum);
                attributes.AddAttribute(ZabShapeFileConstants.Aufnahmeteam, zab.Aufnahmeteam != null ? zab.Aufnahmeteam : string.Empty);

                attributes.AddAttribute(ZabShapeFileConstants.FBZustandsindex, (double)zab.Zustandsindex);
                attributes.AddAttribute(ZabShapeFileConstants.FBMassnahmenvorschlag, zab.MassnahmenvorschlagFahrbahn != null ? zab.MassnahmenvorschlagFahrbahn.Typ : string.Empty);
                attributes.AddAttribute(ZabShapeFileConstants.FBKosten, fbkosten);
                attributes.AddAttribute(ZabShapeFileConstants.FBDringlichkeit, ZabShapeFileConstants.getDringlichkeit(zab.DringlichkeitFahrbahn));
                attributes.AddAttribute(ZabShapeFileConstants.FBGesamtkosten, fbkosten * areafb);

                attributes.AddAttribute(ZabShapeFileConstants.TRRZustandsindex, ZabShapeFileConstants.getTrottoirZustand(zab.ZustandsindexTrottoirRechts));
                attributes.AddAttribute(ZabShapeFileConstants.TRRMassnahmenvorschlag, zab.MassnahmenvorschlagTrottoirRechts != null ? zab.MassnahmenvorschlagTrottoirRechts.Typ : string.Empty);
                attributes.AddAttribute(ZabShapeFileConstants.TRRKosten, trrkosten);
                attributes.AddAttribute(ZabShapeFileConstants.TRRDringlichkeit, ZabShapeFileConstants.getDringlichkeit(zab.DringlichkeitTrottoirRechts));
                attributes.AddAttribute(ZabShapeFileConstants.TRRGesamtkosten, trrkosten * areatrr);

                attributes.AddAttribute(ZabShapeFileConstants.TRLZustandsindex, ZabShapeFileConstants.getTrottoirZustand(zab.ZustandsindexTrottoirLinks));
                attributes.AddAttribute(ZabShapeFileConstants.TRLMassnahmenvorschlag, zab.MassnahmenvorschlagTrottoirLinks != null ? zab.MassnahmenvorschlagTrottoirLinks.Typ : string.Empty);
                attributes.AddAttribute(ZabShapeFileConstants.TRLKosten, trlkosten);
                attributes.AddAttribute(ZabShapeFileConstants.TRLDringlichkeit, ZabShapeFileConstants.getDringlichkeit(zab.DringlichkeitTrottoirLinks));
                attributes.AddAttribute(ZabShapeFileConstants.TRLGesamtkosten, trlkosten * areatrl);



                feature.Attributes = attributes;
                features.Add(feature);
            }
            return(features);
            //shpShxSerializeService.WriteShpShxDbf(features, fileName);
        }