dkyleward / TCNetCheck

Suite of GISDK tools to check TrandCAD Link DBDs
1 stars 2 forks source link

Use network partition script in d.a.m. #1

Open dkyleward opened 8 years ago

dkyleward commented 8 years ago

My email to caliper:

I have a process that iterates (a lot) and performs a SelectByVicinity() operation each time. My understanding is that a 1 mile search space in this function is a straight-line distance. I’d like for that distance to be network distance. In addition, I don’t really want to create an imprecise polygon buffer or network band (like a isochrones band or something).

Instead, I’d like for the program to simply try and travel as far along the network as possible before hitting the distance cap – selecting all links along the way. Of course, the actual way to solve the problem wouldn’t work like that, but it’s a useful way of explaining the final picture.

Is there something like this? The closest I could find is the network bands tool, but that spends a lot of time making smooth bands – which I don’t want/need. I don’t fully understand the “To Value” option of the CreateBuffer() function, but I don’t think that’s the right path, either.

I feel like this is something you guys have to have – maybe even used by the starting point of your isochrones function. Anyway, it would be amazing to make this improvement over my current straight-line approach!

dkyleward commented 8 years ago

Email back from Jim:

Hi, Kyle. We do have a network partitioning macro that you can call. After you open up your line and node layers and create a selection set on a node you wish to have as the origin of the search, network partitioning will create an output link and/or node table that will contain the cost from that link/node to the origin selected node. This doesn't make bands but it puts the results directly on the link and/or node. As an example, you can open up bestrout.map in our tutorial files, select a random node and then call the following:

opts = null opts.Minimize = "[Highway].[Travel Time]" opts.[Link Index] = 2 // second network field name opts.[Link Set] = null // should probably always be null opts.[Node Set] = "CDF Node Layer|Selection" // origin node(s) opts.Output.[Node Table] = {"C:\foo\nodes.bin", "FFB", "Node Allocation"} opts.Output.[Link Table] = {"C:\foo\links.bin", "FFB", "Link Allocation"} opts.Output.[Partitioning] = "C:\foo\partitioning.bin" Ret = RunMacro("TC Network Partitioning", opts) Regards, Jim

dkyleward commented 8 years ago

Currently, the macro uses a simple buffer (straight line distance). Later, links are dropped if their average distance exceeds the buffer distance (using node skim table). Implementing this would be cleaner, and is likely faster.