11 Replies Latest reply on Feb 14, 2017 12:36 AM by Francesco Giovinazzo

    Spatial Analysis between Meters and Transformers

    Jim Kyle

      Hi,

       

      I am about to begin development of Geospatial tool that will look into our electric distribution network to try to determine which meters are connected to possibly the wrong transformer in our data.  Another part of this is possibly creating a little app to allow field personnel to change the Transformer to Meter relationship on these potentially incorrectly related features in the field and correct them during a field audit/visit.

       

      I am not exactly sure about how to go about this process - possibly start with identifying transformers that appear to be too far away to their related/connected meter and then possibly identifying/comparing between AMI data and GIS data.

       

      A quick internet search on this issue reveals that it kind of a common problem with electrical utility data so the point of this email is I am wondering if anybody out there has already gone through this process and could provide any insights on this topic? (and or if they have any geoprocessing script templates they would be willing to share).

       

      Thanks.

        • Re: Spatial Analysis between Meters and Transformers
          Mike Tulis

          I had similar question and here is the solution: How can I trace and record transformer information in meter attributes?  I hope this helps you.

           

          We are using Survalent's GIS Wizard to trace transformer <-> meter relationship instead. The tool uses linear connectivity rules (developed for GIS integration with SCADA and OMS). We then copy the results into GIS.

          • Re: Spatial Analysis between Meters and Transformers
            Mike Tulis

            How can I trace and record transformer information in meter attributes?

            This question has been Answered.

            Mike TulisNewbie

             

            Visibility: , Jim Kyle

            I would like to find a way to trace all meters to the transformer from which they are being fed. Then record the transformer ObjectID (e.g. 10959) in the related meter attributes. As shown in the pictures below the highlighted 11 meters are fed from single B phase 50 kV pole mounted transformer 3-305 (ObjectID 10959). Is there an existing ArcFM tool that would trace entire network and record transformer ObjectIDs to its related Meters attribute (TransformerObjectID).

            Meter Transformer Relationship.pngTransformer Meter Relationship2.png

            Your feedback is greatly appreciated. I am not sure where to start, but I am sure I am not the only person who would like to automate this process. Thank you. Mike.

             

            Francesco Giovinazzo
            Correct Answerby Francesco Giovinazzo on 08-Oct-2014 07:57

             

            Hello Mike,

             

            in this C# snippet I start from a switch in my system and trace all the downstream features, selecting them. The trace task will try to determine the flow from the starting junction, if it fails you should pass the EID of the element from which the flow is coming, aiding procedure.

             

            You can iterate through the results searching only for the features you need and perform updates, the functions at the bottom are ArcFM Samples I have found in the past.

             

            Let me know if you need further help

             

            Regards

             

            Fra

             

            List<IFeature> ListaBarriere = setup a list of barriers if you need them

            IFeature Interruttore = ... get your junction feature from where to start the trace

             

             

             

            INetworkClass pNetClass = (INetworkClass)Interruttore.Class;

            INetwork pNetwork = pNetClass.GeometricNetwork.Network;

            INetElements pNetEl = (INetElements)pNetwork;

            INetTopology pTopo = (INetTopology)pNetwork;

             

             

            int EID = pNetEl.GetEID(Interruttore.Class.ObjectClassID, Interruttore.OID, -1, esriElementType.esriETJunction);

             

             

             

            // create an instance of the Feeder Manager class

            // that performs electric tracing functions

            IMMElectricTracing elecTrace = new MMFeederTracerClass();

             

             

            IMMCurrentStatus cs = null;

             

             

             

            // the tracing results will be returned in these variables

            IMMTracedElements tracedJcts;

            IMMTracedElements tracedEdgs;

             

             

            int[] barrierJncts = new int[ListaBarriere.Count];

            int[] barrierEdges = new int[0];

             

             

             

            //setting the barriers with the appropriate EID

            int indice = 0;

            foreach (IFeature pBarriera in ListaBarriere)

            {

              int barriera_eid = pNetEl.GetEID(pBarriera.Class.ObjectClassID, pBarriera.OID, -1, esriElementType.esriETJunction);

              barrierJncts[indice] = barriera_eid;

              indice++;

            }

             

             

             

            //setting trace parameters

            IMMElectricTraceSettings pSettings = new MMElectricTraceSettingsClass();

            pSettings.RespectConductorPhasing = true;

            pSettings.RespectEnabledField = true;

            IMMElectricTraceSettingsEx pSettingEx = (IMMElectricTraceSettingsEx)pSettings;

            pSettingEx.UseFeederManagerCircuitSources = true;

             

             

             

            //executing the trace

            elecTrace.TraceDownstream(pNetClass.GeometricNetwork,

              pSettingEx,

              cs,

              EID,

              esriElementType.esriETJunction,

              SetOfPhases.abc,

              mmDirectionInfo.establishBySourceSearch,

              0,

              esriElementType.esriETJunction,

              barrierJncts,

              barrierEdges,

              true,

              out tracedJcts,

              out tracedEdgs);

             

             

             

            //results are here, you can enumerate the junctions searching only for the featureclasses you need

            IEnumNetEID TracedJunctions = ConvertTracedElementsCollectionToEnumNetEid(tracedJcts, pNetwork);

            IEnumNetEID TracedEdges = ConvertTracedElementsCollectionToEnumNetEid(tracedEdgs, pNetwork);

             

             

             

            //if needed, draw or select (maybe looping through IFeatureSelection is easier)

            DrawOrSelectTraceResults(TracedJunctions, TracedEdges, true);

             

             

            //...

             

             

             

             

             

            //function to convert from collection to enum net eid

            public IEnumNetEID ConvertTracedElementsCollectionToEnumNetEid(IMMTracedElements tracedElements, INetwork network)

            {

              // we have a feedpath, now we want to extract all the elements of one type and

              // put them in an esri enumneteid so we can display it on the map or other fun stuff

              IEnumNetEID resultEnum = null;

             

             

              IEnumNetEIDBuilder enumNetEIDBuilder = new EnumNetEIDArrayClass();

              enumNetEIDBuilder.Network = network;

              enumNetEIDBuilder.ElementType = (esriElementType)tracedElements.ElementType;

             

             

              INetElements netElements = network as INetElements;

             

             

              if ((netElements != null) && (esriElementType.esriETEdge == (esriElementType)tracedElements.ElementType))

              {

              tracedElements.Reset();

              IMMTracedElement tracedElement = tracedElements.Next();

              while (tracedElement != null)

              {

              IEnumNetEID tempEnumNetEID = netElements.GetEIDs(tracedElement.FCID, tracedElement.OID, esriElementType.esriETEdge);

              tempEnumNetEID.Reset();

              for (int eid = tempEnumNetEID.Next(); eid > 0; eid = tempEnumNetEID.Next())

              {

              enumNetEIDBuilder.Add(eid);

              }

              tracedElement = tracedElements.Next();

              }

              }

              else

              {

              tracedElements.Reset();

              IMMTracedElement tracedElement = tracedElements.Next();

              while (tracedElement != null)

              {

              enumNetEIDBuilder.Add(tracedElement.EID);

              tracedElement = tracedElements.Next();

              }

              }

              resultEnum = enumNetEIDBuilder as IEnumNetEID;

              return resultEnum;

            }

             

             

             

            //function to select or draw

            public void DrawOrSelectTraceResults(IEnumNetEID junctionList, IEnumNetEID edgeList, bool overrideSelectSetting)

            {

              //obtain a reference to the interface by querying the application for the Utility Network Analysis extension

              UID networkExtensionUID = new UIDClass();

              networkExtensionUID.Value = "esriEditorExt.UtilityNetworkAnalysisExt";

              INetworkAnalysisExt networkExtension = m_app.FindExtensionByCLSID(networkExtensionUID) as INetworkAnalysisExt;

             

             

              if (networkExtension != null)

              {

              INetworkAnalysisExtResults networkAnalysisResults = networkExtension as INetworkAnalysisExtResults;

              networkAnalysisResults.ClearResults();

             

             

              networkAnalysisResults.SetResults(junctionList, edgeList);

              //determine if results should be drawn

              if (networkAnalysisResults.ResultsAsSelection)

              {

              networkAnalysisResults.CreateSelection(junctionList, edgeList);

              }

              else if (overrideSelectSetting)

              {

              // temporarily toggle the user's setting

              networkAnalysisResults.ResultsAsSelection = true;

              networkAnalysisResults.CreateSelection(junctionList, edgeList);

              networkAnalysisResults.ResultsAsSelection = false;

              }

             

             

              networkAnalysisResults.ClearResults();

              networkAnalysisResults = null;

              }

             

             

              networkExtensionUID = null;

              networkExtension = null;

            }

            See the answer in context

             

            Average User Rating: No ratings (0 ratings)
            •  

              Re: How can I trace and record transformer information in meter attributes?
              Francesco GiovinazzoJourneymanHello Mike, I have used electric traces from C# code several times, if you need help I can provide a sample, the tracewill result in the EID of each junction or edge connected based on the trace you use, from the EID you can find the corresponding feature and if it's a transformer you can perform whatever operation you want. Regards Francesco

               

              •  

                Re: How can I trace and record transformer information in meter attributes?
                Mike TulisNewbieBuon Giorno Francesco, Thank you for your prompt reply. I would like to see the sample code and methodology how you accomplished this task. Please bear in mind that my programming skills are rusty and limited , but I am more than willing to try and learn . Mike

                 

                •  

                  Correct AnswerRe: How can I trace and record transformer information in meter attributes?
                  Francesco GiovinazzoJourneymanHello Mike, in this C# snippet I start from a switch in my system and trace all the downstream features, selecting them. The trace task will try to determine the flow from the starting junction, if it fails you should pass the EID of the element from which the flow is coming, aiding procedure. You can iterate through the results searching only for the features you need and perform updates, the functions at the bottom are ArcFM Samples I have found in the past. Let me know if you need further help Regards Fra
                  List<IFeature> ListaBarriere = setup a list of barriers if you need themIFeature Interruttore = ... get your junction feature from where to start the trace INetworkClass pNetClass = (INetworkClass)Interruttore.Class;INetwork pNetwork = pNetClass.GeometricNetwork.Network;INetElements pNetEl = (INetElements)pNetwork;INetTopology pTopo = (INetTopology)pNetwork; int EID = pNetEl.GetEID(Interruttore.Class.ObjectClassID, Interruttore.OID, -1, esriElementType.esriETJunction); // create an instance of the Feeder Manager class// that performs electric tracing functionsIMMElectricTracing elecTrace = new MMFeederTracerClass(); IMMCurrentStatus cs = null; // the tracing results will be returned in these variablesIMMTracedElements tracedJcts;IMMTracedElements tracedEdgs; int[] barrierJncts = new int[ListaBarriere.Count];int[] barrierEdges = new int[0]; //setting the barriers with the appropriate EIDint indice = 0;foreach (IFeature pBarriera in ListaBarriere){  int barriera_eid = pNetEl.GetEID(pBarriera.Class.ObjectClassID, pBarriera.OID, -1, esriElementType.esriETJunction);  barrierJncts[indice] = barriera_eid;  indice++;} //setting trace parametersIMMElectricTraceSettings pSettings = new MMElectricTraceSettingsClass();pSettings.RespectConductorPhasing = true;pSettings.RespectEnabledField = true;IMMElectricTraceSettingsEx pSettingEx = (IMMElectricTraceSettingsEx)pSettings;pSettingEx.UseFeederManagerCircuitSources = true; //executing the traceelecTrace.TraceDownstream(pNetClass.GeometricNetwork,  pSettingEx,  cs,  EID,  esriElementType.esriETJunction,  SetOfPhases.abc,  mmDirectionInfo.establishBySourceSearch,  0,  esriElementType.esriETJunction,  barrierJncts,  barrierEdges,  true,  out tracedJcts,  out tracedEdgs); //results are here, you can enumerate the junctions searching only for the featureclasses you needIEnumNetEID TracedJunctions = ConvertTracedElementsCollectionToEnumNetEid(tracedJcts, pNetwork);IEnumNetEID TracedEdges = ConvertTracedElementsCollectionToEnumNetEid(tracedEdgs, pNetwork); //if needed, draw or select (maybe looping through IFeatureSelection is easier)DrawOrSelectTraceResults(TracedJunctions, TracedEdges, true); //... //function to convert from collection to enum net eidpublic IEnumNetEID ConvertTracedElementsCollectionToEnumNetEid(IMMTracedElements tracedElements, INetwork network){  // we have a feedpath, now we want to extract all the elements of one type and  // put them in an esri enumneteid so we can display it on the map or other fun stuff  IEnumNetEID resultEnum = null;   IEnumNetEIDBuilder enumNetEIDBuilder = new EnumNetEIDArrayClass();  enumNetEIDBuilder.Network = network;  enumNetEIDBuilder.ElementType = (esriElementType)tracedElements.ElementType;   INetElements netElements = network as INetElements;   if ((netElements != null) && (esriElementType.esriETEdge == (esriElementType)tracedElements.ElementType))  {  tracedElements.Reset();  IMMTracedElement tracedElement = tracedElements.Next();  while (tracedElement != null)  {  IEnumNetEID tempEnumNetEID = netElements.GetEIDs(tracedElement.FCID, tracedElement.OID, esriElementType.esriETEdge);  tempEnumNetEID.Reset();  for (int eid = tempEnumNetEID.Next(); eid > 0; eid = tempEnumNetEID.Next())  {  enumNetEIDBuilder.Add(eid);  }  tracedElement = tracedElements.Next();  }  }  else  {  tracedElements.Reset();  IMMTracedElement tracedElement = tracedElements.Next();  while (tracedElement != null)  {  enumNetEIDBuilder.Add(tracedElement.EID);  tracedElement = tracedElements.Next();  }  }  resultEnum = enumNetEIDBuilder as IEnumNetEID;  return resultEnum;} //function to select or drawpublic void DrawOrSelectTraceResults(IEnumNetEID junctionList, IEnumNetEID edgeList, bool overrideSelectSetting){  //obtain a reference to the interface by querying the application for the Utility Network Analysis extension  UID networkExtensionUID = new UIDClass();  networkExtensionUID.Value = "esriEditorExt.UtilityNetworkAnalysisExt";  INetworkAnalysisExt networkExtension = m_app.FindExtensionByCLSID(networkExtensionUID) as INetworkAnalysisExt;   if (networkExtension != null)  {  INetworkAnalysisExtResults networkAnalysisResults = networkExtension as INetworkAnalysisExtResults;  networkAnalysisResults.ClearResults();   networkAnalysisResults.SetResults(junctionList, edgeList);  //determine if results should be drawn  if (networkAnalysisResults.ResultsAsSelection)  {  networkAnalysisResults.CreateSelection(junctionList, edgeList);  }  else if (overrideSelectSetting)  {  // temporarily toggle the user's setting  networkAnalysisResults.ResultsAsSelection = true;  networkAnalysisResults.CreateSelection(junctionList, edgeList);  networkAnalysisResults.ResultsAsSelection = false;  }   networkAnalysisResults.ClearResults();  networkAnalysisResults = null;  }   networkExtensionUID = null;  networkExtension = null;}

                   

            • Re: Spatial Analysis between Meters and Transformers
              Francesco Giovinazzo

              Hello,

               

              I am still here, if someone needs help, keep in mind that my snippet above is intended for Feeder Manager 1, we do not have anything on FM2 yet.

               

              Regards

               

              Francesco