Giter Club home page Giter Club logo

Comments (3)

mmorang avatar mmorang commented on June 23, 2024 1

Hmm, I think I know what you're asking for: Your original Origins and Destinations files have some field for an ID or unique code or whatever. You want to transfer this value through to the final output. Is that right?

It's not possible to alter the OriginOID and DestinationOID fields (well, I guess you could in post-processing if you wanted to). But what you can do is pass through the original field values in addition to OriginOID and DestinationOID. You'll need to include your fields in the inputs when calling the load() method, and then once the OD Cost Matrix is solved, you'll need to join the output Origins and Destinations to the Lines to transfer over the values of that field.

This section in the arcpy.nax documentation explains how to include custom fields when loading inputs. You'll want to apply this information here: https://github.com/Esri/large-network-analysis-tools/blob/master/parallel_odcm.py#L312-L356. There's already some fields getting added and mapped, so it should be a straightforward addition to what's already happening.

For doing the join on the results, the code is actually already doing a similar join in the case where the network data source is a service. It's transferring the ObjectIDs, but the same idea would apply to any other field. You can see that here: https://github.com/Esri/large-network-analysis-tools/blob/master/parallel_odcm.py#L493-L524. The key thing to understand is that the fields in the input Origins and Destinations get transferred to the output Origins and Destinations. The OriginOID field in the output Lines refers to the ObjectID field in the output Origins, and the DestinationOID field in Lines refers to the ObjectID field in the output Destinations. So you'll want to use these fields to make joins and transfer any other fields you want over to Lines.

(I'm not sure what kind of output you want, and the steps may differ a little for feature class, CSV, or Arrow.)

from large-network-analysis-tools.

mmorang avatar mmorang commented on June 23, 2024

Did this satisfactorily answer your question? If so, please close the issue. (But it's okay if you need some time to think about it and play with it.)

from large-network-analysis-tools.

Erin-1919 avatar Erin-1919 commented on June 23, 2024

Thank you; it helps a lot.

from large-network-analysis-tools.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.