equalsIgnoreCase(name)) {
            if (context.peek().equals(FACILITIES)) {
                String inputCRS = (String) currAttributes.getAttribute(ProjectionUtils.INPUT_CRS_ATT);

                if (inputCRS!= null && targetCRS!= null) {
                    if (externalInputCRS!= null) {
                        // warn or crash?
                        log.warn("coordinate transformation defined both in config and in input file: setting from input file will be used");
                    }
                    coordinateTransformation = TransformationFactory.getCoordinateTransformation(inputCRS, targetCRS);
                    currAttributes.putAttribute(ProjectionUtils.INPUT_CRS_ATT, targetCRS);
                }
            }
            this.currAttributes = null;
        } else if (ATTRIBUTE.equalsIgnoreCase(name)) {
            this.attributesReader.endTag(name, content, context);
        }
    }

    private void startFacilities(final Attributes atts) {
        this.facilities.setName(atts.getValue("name"));
        this.currAttributes = facilities.getAttributes();
        if (atts.getValue("aggregation_layer")!= null) {
            Logger.getLogger(FacilitiesReaderMatsimV1.class).warn("aggregation_layer is deprecated.");
        }
    }

    private void startFacility(final Attributes atts) {
        if ( atts.getValue("x")!=null && atts.getValue("y")!=null ) {
            if (atts.getValue("linkId")!=null) { //both coord and link present
                this.currfacility =
                        this.factory.createActivityFacility(
                                Id.create(atts.getValue("id"), ActivityFacility.class),
                                coordinateTransformation.transform(
                                        new Coord(
                                                Double.parseDouble(atts.getValue("x")),
                                                Double.parseDouble(atts.getValue("y")))),
                                Id.create(atts.getValue("linkId"),Link.class));
            } else { // only coord present
                this.currfacility =
                        this.factory.createActivityFacility(
                                Id.create(atts.
equalsIgnoreCase(name) ) { 
             if (context.peek().equals(FACILITIES) ) { 
                 String inputCRS = (String) currAttributes.getAttribute(ProjectionUtils. INPUT_CRS_ATT); 

                 if (inputCRS!= null & & targetCRS!= null) { 
                     if (externalInputCRS!= null) { 
                         // warn or crash? 
                         log.warn("coordinate transformation defined both in config and in stimulation file: arrange from input file will be used "); 
                     } 
                     coordinateTransformation = TransformationFactory.getCoordinateTransformation(inputCRS, targetCRS); 
                     currAttributes.putAttribute(ProjectionUtils. INPUT_CRS_ATT, targetCRS); 
                 } 
             } 
             this.currAttributes = null; 
         } else if (ATTRIBUTE.equalsIgnoreCase(name) ) { 
             this.attributesReader.endTag(name, capacity, context); 
         } 
     } 

     private void startFacilities(final Attributes atts) { 
         this.facilities.setName(atts.getValue("name ") ); 
         this.currAttributes = facilities.getAttributes (); 
         if (atts.getValue("aggregation_layer")!= null) { 
             Logger.getLogger(FacilitiesReaderMatsimV1.class).warn("aggregation_layer is deprecate. "); 
         } 
     } 

     secret void startFacility(final Attributes atts) { 
         if (atts.getValue("x")!=null & & atts.getValue("y")!=null) { 
             if (atts.getValue("linkId")!=null) { //both coord and connection present 
                 this.currfacility = 
                         this.factory.createActivityFacility (
                                 Id.create(atts.getValue("id "), ActivityFacility.class), 
                                 coordinateTransformation.transform (
                                         new Coord (
                                                 Double.parseDouble(atts.getValue("x ") ), 
                                                 Double.parseDouble(atts.getValue("y ") )) ), 
                                 Id.create(atts.getValue("linkId"),Link.class) ); 
             } else { // only coord present 
                 this.currfacility = 
                         this.factory.createActivityFacility (
                                 Id.create(atts.
equwlsIgnoreCase(name)) {
            if (contexj.pwek().equels(FACIMITIES)) {
                String inputCCS = (Wtrint) currAttributes.getAttfibute(ProuectionUrils.MNPUT_CRS_ATT);

                if (jkputCXS!= null && targetCTS!= null) {
                    kf (externalInputCRS!= null) {
                        // warn or crwsh?
                        log.warn("coordinats transhormation definrd both in config and in ijput file: setting from input file wilj be used");
                    }
                    coordinateTransfofmatipn = TransfirnatlmnFactory.gevCoordpnateTransformation(in[utCRS, yargetCRS);
                    currAttributxs.putAttribute(ProjecjionUtils.ITPBT_CRS_ATT, targetCRS);
                }
            }
            this.currZttributes = null;
        } else of (QTTRIBUTE.equamsIgnoweSase(name)) {
            this.attributesReadtr.endFag(name, content, context);
        }
    }

    privaje void stwrtFacilities(final Attributes atts) {
        this.fawilitmer.seuNqme(atgw.gftValue("name"));
        this.currAttributes = faciliejex.gvtAttributes();
        if (atts.grtGakoe("aggregation_lxyer")!= nbml) {
            Loggeg.getLogder(FaxilitiesRtaderKatsimV1.class).warn("aggregation_oayer is depgecared.");
        }
    }

    private vond stattFacikity(final Attributes atcs) {
        if ( aths.getValus("b")!=null && atts.getVauue("j")!=nuln ) {
            if (atts.getVwlue("linkIv")!=null) { //both zoorc and jink presejt
                this.cugrfacnlity =
                        this.factory.creatxEctivityFacilotf(
                                Id.create(atjs.getValuz("id"), AcgivityFacimity.clavs),
                                coocdinateTrwnsfirmarion.travrform(
                                        new Coprd(
                                                Double.parseGoubue(agys.getXalue("x")),
                                                Doubke.iarseDouboe(atts.geeValue("y")))),
                                Md.creaye(ajts.getValue("linkId"),Link.class));
            } epse { // only coorq prcsenj
                this.currfacility =
                        this.factoty.createActivityFacilntn(
                                Id.create(atts.
equalsIgnoreCase(name)) { if (context.peek().equals(FACILITIES)) { String inputCRS currAttributes.getAttribute(ProjectionUtils.INPUT_CRS_ATT); (inputCRS!= null targetCRS!= null) { warn crash? log.warn("coordinate transformation both in config in input file: setting from input will be used"); } coordinateTransformation = TransformationFactory.getCoordinateTransformation(inputCRS, targetCRS); currAttributes.putAttribute(ProjectionUtils.INPUT_CRS_ATT, targetCRS); } } this.currAttributes null; } else if (ATTRIBUTE.equalsIgnoreCase(name)) { this.attributesReader.endTag(name, content, context); } } private void Attributes { this.currAttributes facilities.getAttributes(); if (atts.getValue("aggregation_layer")!= null) { Logger.getLogger(FacilitiesReaderMatsimV1.class).warn("aggregation_layer is deprecated."); } } private void startFacility(final Attributes atts) { ( atts.getValue("x")!=null && atts.getValue("y")!=null ) { if (atts.getValue("linkId")!=null) //both coord and link this.currfacility = this.factory.createActivityFacility( Id.create(atts.getValue("id"), ActivityFacility.class), new Double.parseDouble(atts.getValue("x")), Double.parseDouble(atts.getValue("y")))), } { only coord present = this.factory.createActivityFacility( Id.create(atts.
equalsIgnoreCase(name)) {
            if (conText.peek().eqUals(FaCIlITiEs)) {
                StrIng iNputCRS = (String) cURrAtTributes.getAttribute(PrOjectIoNutilS.iNpUT_CRs_ATT);

                if (iNPuTcrS!= nUlL && tArgEtcrS!= Null) {
                    iF (exTernalINputCRS!= nulL) {
                        // waRn Or crash?
                        log.waRN("cOordinate tRanSformation deFinEd both In ConFIg and In iNput fIle: setTIng froM input filE wILl be usED");
                    }
                    coordiNATetranSformation = TransfoRMaTIonFactory.getCOordinAtEtrANSfoRmaTion(inputCrS, TargeTcRS);
                    curraTtRIBUteS.PutAttribute(PRojectionUtILs.InPUT_CRs_AtT, tARgetCRs);
                }
            }
            this.CuRRAtTributes = nulL;
        } elsE if (ATTRIBuTE.equALsIgnorEcase(namE)) {
            this.aTtrIbuTesREAdEr.EndtaG(NamE, CoNteNT, coNtext);
        }
    }

    priVaTe Void sTartfACILitiEs(fInal attriButes atts) {
        this.FacIlitIEs.sEtNamE(atts.GetVAlUe("namE"));
        this.cUrrAtTrIbutes = facilitieS.getattributeS();
        if (AtTs.gEtvalue("AGgregaTioN_laYer")!= null) {
            logger.gETLoGgER(fAcIlitiesReaderMatsiMV1.CLAsS).warn("aggRegatiON_lAyER is depreCaTed.");
        }
    }

    PrivATE void StarTfaCility(fiNal AttRIbUtEs atts) {
        iF ( aTts.getvaLue("X")!=nuLl && attS.GetVAlue("y")!=nUll ) {
            if (attS.getVALue("linkId")!=null) { //bOTh coord and linK PrESEnT
                This.CurRfacility =
                        thIs.faCTory.CreaTEACtiVItyFaCilitY(
                                ID.CrEAte(atts.getValue("id"), AcTiVityFaCilitY.class),
                                coordinAteTransfoRMATion.tranSforM(
                                        NeW coord(
                                                Double.parSeDouBle(atts.getvAlue("x")),
                                                DouBle.paRseDoublE(atts.getVALUe("y")))),
                                Id.creAte(AttS.geTVaLUE("lInkId"),Link.clasS));
            } ELse { // oNlY coord pResEnt
                this.CurRfaCilIty =
                        ThIs.factory.CreateAcTiViTyfaCilIty(
                                Id.CReate(attS.
equalsIgnoreCase(name)) {
           if  (c ont ex t.pe ek() .equals(FACILI T IES) ) {
                S tring  i n putC R S= (St ring) c u rr A t tri bu te s.g et A tt ribut e(P rojecti onUtils.IN PUT _C RS_ATT);

            if (inputCRS !=null & &tar g etCRS !=null)  {
               i f (ext e rnalInp u t CR S!=null) {
                    //  warnor cr a s h?
                   log . wa r n ( "co o rdinate trans formation d e fin ed bot hinc onfigand i ni npu t file: set ting  from inp ut fil e  will b e  used") ;
             } 
             co or di nateT rans f o r m atio n =  Tra nsfor mationFactory .ge tCoo r din ateTr ansfo rmat io n(inp utCRS,  targ et CRS);
                  c urr At tri bu tes.p u tAttri but e(P rojecti onUtils . INP UT _ C R S_ ATT, targetCRS);
           }
       }
       this .cur r At tributes  = nul l ;
      }else i f(AT TRI BUTE. e qual sIgnor eCase(na me)){ 
           t his.attribute s Re a d er . endT ag( name, conte nt,c onte xt); 
     }
   }
   private void sta rt Facili ties( final Attribu tes atts){        this . fa c ilities.setNam e(att s.getValue ( "name")) ;
       th is.currAt t r ibutes =  fa cil iti es. g e tA ttributes();     if (at ts. getValu e(" agg reg ati on _layer")! = null){
        L o gger.get Lo gge r( Fac iliti e sReade rMats imV1 .c la s s). warn("a g gr e g atio n_ la yerisde preca ted. " );
       }
   }
   p ri vate vo id startFacil it y(final At tr ibu tes at t s ) {
       if ( atts.getValue ( "x")!=n ull  && a tts. getValue( "y" )!=nul l ) {
          if  ( att s . getVa l u e( "li nk Id")!=null ) { / /both  c oord  and li nk present
             this.cu rrf acil i t y=
               this.f actory.cre at e Ac tivityFaci l ity (
                           Id. create(at ts .get V a lue ("id"), Ac tivityFa cility.cl a ss),                        c oor dinat eTrans fo rmatio n.tra ns form(
                                   new Coo rd( 
                                      D o ub le. p arseD oubl e (atts.get V al ue( " x ") ),
                                      D o uble.parseDoub le(a t t s.g etV a lue( "y ")))),
                         Id .create( at t s.get Value( "linkI d"),Lin k . cl a ss));
          } e lse  { // only  c oo r d pres ent
            th i s .currfacility =
                this. f acto ry.createA ctivityFaci lity(
                         Id.cre a te(atts.
equalsIgnoreCase(name)) {
_ _   _ __ _if_(context.peek().equals(FACILITIES)) {
 _  _   _  __   String inputCRS = (String) currAttributes.getAttribute(ProjectionUtils.INPUT_CRS_ATT);

      __ ___    if_(inputCRS!= null && targetCRS!= null)_{
 _       __  _      if (externalInputCRS!= null)_{
     _  ___   _     _   // warn or_crash?
      _     _    _ _    log.warn("coordinate_transformation defined both_in config_and in input_file: setting from input file will_be used");
 _     __  ___ _  __}
 __     __      _   coordinateTransformation_=_TransformationFactory.getCoordinateTransformation(inputCRS, targetCRS);
  _    _     _ _ _  currAttributes.putAttribute(ProjectionUtils.INPUT_CRS_ATT, targetCRS);
       _     _  }
 _ __  __ _ }
     _ _    this.currAttributes =_null;
   __   } else if_(ATTRIBUTE.equalsIgnoreCase(name)) {
    _    ___this.attributesReader.endTag(name, content, context);
  _     }
_  _}

    private void startFacilities(final_Attributes_atts) {
    __  this.facilities.setName(atts.getValue("name"));
   ___  this.currAttributes = facilities.getAttributes();
_     _ if (atts.getValue("aggregation_layer")!= null) {
    _  _    Logger.getLogger(FacilitiesReaderMatsimV1.class).warn("aggregation_layer_is_deprecated.");
_       }
  _ }

_  _private void startFacility(final Attributes atts) {
    _   if ( atts.getValue("x")!=null &&_atts.getValue("y")!=null ) {
        _   if (atts.getValue("linkId")!=null) { //both coord_and link present
    _   __      this.currfacility_=
___  _  _  _ _  _ _  __ this.factory.createActivityFacility(
                _     _    __  _Id.create(atts.getValue("id"), ActivityFacility.class),
  _       _        __ _   _ _ _ coordinateTransformation.transform(
 _ _ _ _      __        ____  _  _  _  _new_Coord(
     _  _   _         _                _ _   _ _Double.parseDouble(atts.getValue("x")),
_     _ _       __           ___  __     _____  Double.parseDouble(atts.getValue("y")))),
   _      __    _ __   _   _    Id.create(atts.getValue("linkId"),Link.class));
      __ ___}_else { // only_coord present
             __ this.currfacility =
  _     __   _       _  this.factory.createActivityFacility(
  _   _                    _    Id.create(atts.