I am aware that I cannot use the sql_clause parameter on arcpy in-memory layers, the dataset must exist in a database. However, the program I have written must then write out a file every single time I run a network analyst problem (and subsequently delete it). I am working with tens of thousands or records, and half a dozen or so route solves per record. I need to reduce my iteration processing times as much as possible, and not having to write out a file every time would save a ton of time.
I am specifically trying to sort the junctions output from the copy traversed features method on a closest facility later, stored in-memory of course.
Any work-around would be much appreciated. Thanks!
I have tried list comprehension, but the output didn't make sense. I need to revisit tomorrow, however.
I believe I understand your overall challenge, but I can't provide any specific feedback without knowing more about your data. Can you provide some examples or attach an extract of your data and explain what you are trying to do with the data?
I just realized something, so let me test before I send you a reply.
Thanks for your response!
Hi Josh,
Thanks for the quick response. I just realized something that I need to test, and I broke my program, so Im debugging at the moment. I’ll update you if I figure out the solution!
Thanks!
Arjun
Okay, I was able to switch around my facilities/incidents and “travel_to/from” parameters to sort out in the order I needed and therefore didn’t have to worry about sorting again later.
Thanks for your help though!
You could use Sort—Help | ArcGIS for Desktop to sort your data. You may also be interested in Generate Near Table—Help | ArcGIS for Desktop
Thanks for the help. I looked into Sort, but it write’s out another table to disc which I then have to read. I am trying to avoid writing to disc, same with generate near table.
I have also looked into a list comprehension as well, which I was able to get partly. I need to look into a bit more.
Both of the tools can be used in_memory
That may work then. I just want to try and limit the number of extra steps as well. I’ll look into it. Thanks!