POST
|
Hello! I'll set up a 10.2.2 machine to try out the sample and see if there is a problem with that release. In the meantime, are you running with background GP (64 bit)? Or in the foreground (32bit)? If it is background, try turning off background GP to see if the sample works in 32bit. The "interface not supported" part of your error makes me concerned that something broke in 10.2.2, so I'll try that in the meantime. This might take me a bit, so if you need help more urgently, please contact tech support. Thanks
... View more
06-17-2014
07:41 AM
|
0
|
0
|
1165
|
POST
|
Hello! Which sample did you download? Was it this one: http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/#/Sample_Vehicle_routing_problem_solver/0001000001s3000000/ Which version of the software are you on? As for your questions: "1. When I tried adding one more attribute "Cost" (Usage typ///) value= minutes, I get an exception "Input string is not in a correct format" Where did you add a cost attribute? What line of code threw the exception? What network dataset are you using? "2. When I change distance unit attribute from mile to meter I get exception "No Orders Routed" Were you getting a correct solve before? Which line of code are you using to change the distance attribute. Thanks for being patient. We'll figure this out.
... View more
01-28-2014
05:58 AM
|
0
|
0
|
451
|
POST
|
There was a bug in the SDK code. Thanks to Cory for tracking it down. Here is the new and improved load by location fields code:
public void LoadAnalysisObjectsByField(ESRI.ArcGIS.Geodatabase.ITable inputClass, string naClassName, ESRI.ArcGIS.NetworkAnalyst.INAContext naContext)
{
// Create and add a fields agent
var fieldsAgent = new ESRI.ArcGIS.NetworkAnalyst.NALocatorLocationFieldsAgentClass() as ESRI.ArcGIS.NetworkAnalyst.INALocatorLocationFieldsAgent2;
// Set the field names appropriately based on input data and NAClass
var naClass = naContext.NAClasses.get_ItemByName(naClassName) as ESRI.ArcGIS.NetworkAnalyst.INAClass;
var naFeatureClass = naClass as ESRI.ArcGIS.Geodatabase.IFeatureClass;
// Check to see if the NAClass is of type NALocation or NALocationRanges
ESRI.ArcGIS.esriSystem.UID naLocationFeatureUID = new ESRI.ArcGIS.esriSystem.UIDClass();
naLocationFeatureUID.Value = "esriNetworkAnalyst.NALocationFeature";
ESRI.ArcGIS.esriSystem.UID naLocationFeatureRangesUID = new ESRI.ArcGIS.esriSystem.UIDClass();
naLocationFeatureRangesUID.Value = "esriNetworkAnalyst.NALocationRangesFeature";
if (naFeatureClass.CLSID.Compare(naLocationFeatureUID))
{
// The field names listed below are the names used in Network Analyst classes to represent NALocations.
// These are also the names of fields added by the CalculateLocations geoprocessing tool
fieldsAgent.OIDFieldName = "SourceOID";
fieldsAgent.SourceIDFieldName = "SourceID";
fieldsAgent.PositionFieldName = "PosAlong";
fieldsAgent.SideFieldName = "SideOfEdge";
}
else if (naFeatureClass.CLSID.Compare(naLocationFeatureRangesUID))
{
// The location ranges input field must be of type BLOB
fieldsAgent.LocationRangesFieldName = "Locations";
var blobField = inputClass.Fields.get_Field(inputClass.FindField(fieldsAgent.LocationRangesFieldName));
if (blobField.Type != ESRI.ArcGIS.Geodatabase.esriFieldType.esriFieldTypeBlob)
{
System.Windows.Forms.MessageBox.Show("Loading location ranges by field requires a blob field");
return;
}
}
// Bind for a fields agent will properly associate the agent with the network dataset.
// This is useful internally for mapping SourceID back to network sources.
((INALocatorAgent)fieldsAgent).Bind(naContext.NetworkDataset, null);
var posFieldsLocator = new ESRI.ArcGIS.NetworkAnalyst.NALocatorClass() as INALocator;
posFieldsLocator.FindClosestAmongAllAgents = false;
posFieldsLocator.SnapToleranceUnits = ESRI.ArcGIS.esriSystem.esriUnits.esriMeters;
posFieldsLocator.SnapTolerance = 0.0;
// Bind to network dataset is required. Bind has a side effect of adding feature locator agents for all
// feature sources. In this case we only want a field locator agent so remove the feature agents after Bind
// and before adding the field agent to NALocator.
posFieldsLocator.Bind(naContext.NetworkDataset, null);
int locatorAgentCount = posFieldsLocator.LocatorAgentCount;
for (int i = locatorAgentCount - 1; i >= 0; --i)
posFieldsLocator.RemoveLocatorAgent(i);
posFieldsLocator.AddLocatorAgent((INALocatorAgent)fieldsAgent);
((INAContextEdit)naContext).Locator = posFieldsLocator;
// Both Initialize and Load take a cursor from the input class
ESRI.ArcGIS.Geodatabase.ICursor cursor = inputClass.Search(null, false) as ESRI.ArcGIS.Geodatabase.ICursor;
ESRI.ArcGIS.NetworkAnalyst.INAClassLoader2 naClassLoader = new ESRI.ArcGIS.NetworkAnalyst.NAClassLoaderClass();
naClassLoader.Initialize(naContext, naClassName, cursor);
// After Loading is complete, the rowsIn and rowsLocated variable can be used to verify
// that every row from the input feature class has been loaded into the network analysis class
int rowsIn = 0;
int rowsLocated = 0;
naClassLoader.Load(cursor, null, ref rowsIn, ref rowsLocated);
// Now remove the custom fields agent and reset the locator
naContext.Locator.RemoveLocatorAgent(0);
naContext.Locator.Bind(naContext.NetworkDataset, null);
}
... View more
10-16-2013
01:30 PM
|
0
|
0
|
382
|
POST
|
You have found a bug that was fixed, I believe, at 10.2. What version are you on? The issue was that when there are multiple facilities at the same location, the attr_ values were being optimized away. The workaround is to very slightly offset the coincident facilities so that their network location values are not identical. Sorry for the inconvenience. I hope the workaround works for you until you get a chance to upgrade.
... View more
10-15-2013
07:46 AM
|
0
|
0
|
266
|
POST
|
Hello, Cory! Looks like your code matches the code sample exactly. Before I guess at the root problem, here is some background for anyone who might read this thread. Assuming you are loading Stops in a Route... There are 4 fields on the Stops class that represent the network location: SourceOID, SourceID, PosAlong, and SideOfEdge. When the solver uses that stop, it doesn't care about the geometry of the stop, it only uses those location fields to determine where along the network the stop is. When you load by geometry, the class loader takes the input feature's geometry, determines the value of the 4 location fields and populates those fields when the feature is added to the Stops class on the Route. When you load by location fields, your input features already have those 4 location fields which identify the network location. There is no need to determine the nearest network location to the geometry, because we already have the 4 fields populated. Since you are loading by locations and getting zero stops loaded, that might mean that something is up in your input class. The problem is probably in these lines of code: fieldsAgent.OIDFieldName = "SourceOID"; fieldsAgent.SourceIDFieldName = "SourceID"; fieldsAgent.PositionFieldName = "PosAlong"; fieldsAgent.SideFieldName = "SideOfEdge"; Does your input class have "SourceOID", "SourceID", "PosAlong" and "SideOfEdge" fields already? If not, they need to be there. If you have them, but have renamed them to something else, then change the above code to reflect the new names. The purpose of loading by fields is for a slight performance improvement. We can avoid the spatial search for the nearest network location to your stops. If you have to load the same location over and over, or you have to load hundreds or thousands of locations, loading by field can be very helpful. In order for this to work, you need to have previously loaded your stops somehow. And those 4 location fields should already be on your input class. If they aren't there, you can use the CalculateLocations GP tool to pre-calculate your location fields. Or you can load by geometry into a stops class, then export those location fields back onto your input data. I hope I got the right answer and there isn't a bigger problem going on. Let me know if this helped. Good luck!
... View more
10-11-2013
07:39 AM
|
0
|
0
|
382
|
POST
|
Hello, Sherwin! When you think about it, the scale barriers, since they intersect a line in two dimensions can't really add a cost. Robert's point barrier suggestion is the best choice, probably (depending on what your use-case is). Why are you interested in making additive line barriers, out of curiosity? I'd love to hear your use-case. If you know exactly what the cost along an edge is, you could kind-of make it additive. Your barrier scale factor would equal the quantity of the cost of your edge plus your new cost, divided by the cost of your edge. Like this: Scale factor = (additive cost + original edge cost) / original edge cost That could get complicated, though, depending on how the costs for your edge are determined. Also, if you only traverse part of an edge, you will get incorrect apportionment. For example, if you travel 0.5 times the length of the edge, you will still get the full additive cost included.
... View more
09-16-2013
06:12 AM
|
0
|
0
|
425
|
POST
|
If I'm not mistaken, to work with the map control, you need to specifically get an Engine Developer license. Here is a link in the help about it: http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#//000100000m9v000000
... View more
06-13-2013
08:38 AM
|
0
|
0
|
193
|
POST
|
Along with the help Alexey and Joe gave you, there are a couple of other options to try and find disconnected portions of your network. 1 - Use the custom connectivity solver here: http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#//000100000n99000000 Once you have this solver running in ArcMap, you can choose to highlight disconnected areas of your network. This solver does pretty much exactly what you want. 2 - Use Service Area. Turn on lines and turn off polygons for service area. Place facilities as a kind of seed point, then solve large service areas that would cover most, if not all of your network.
... View more
06-04-2013
07:23 AM
|
0
|
0
|
398
|
POST
|
The Network Analyst model for historical traffic is based on how data vendors model traffic. You might want to contact NavTeq or one of the other data vendors to find out how they create and manage the street profiles. Sorry, I can't be of more help. The development of historical traffic support in network datasets was done based on pre-existing historical traffic data provided by data vendors.
... View more
05-28-2013
07:24 AM
|
0
|
0
|
199
|
POST
|
One way to think of this problem is to imagine why wouldn't someone just swap buses in real life. If a person's goal is to get from station 1 to station 3 as quickly as possible, and it is faster for the person to get off of bus 66 at station 2 and get on bus 19, then they should swap buses. One reason might be that bus 19 won't be sitting there waiting for them at station 2 when they get off of bus 66. To model arrive and depart times using network analyst, you will need to use a custom evaluator, as we don't support transit times out-of-the-box. Using custom evaluators gives you great flexibility, but requires higher maintenance as well as some programming knowledge. I think another reason they don't swap buses is the time it takes to get off of one bus and get onto another. This could be modeled by using cost delays. You could digitize a turn in at station 2 that would penalize a switch from bus line 66 to bus line 19. Or instead of connecting both bus lines directly to station two, have a small edge run from each bus line to the station that provides a cost of departing and/or getting on a bus. Either of those solutions would discourage switching by making it take time to switch buses.
... View more
05-23-2013
07:36 AM
|
0
|
0
|
5155
|
POST
|
Very interesting use case! I have seen similar workflows that include different types of vehicles that have different speeds or different abilities to handle road slopes. To support your ideas, you will need to do multiple solves. There is not currently a way to vary attribute parameters within one solve. The parameter is a solver wide variable, as opposed to being specific to a given facility. Solve one Closest Facility for each of your sets of vehicle types. Then, compare the results and choose the vehicle that arrived the quickest.
... View more
05-23-2013
07:09 AM
|
0
|
0
|
234
|
POST
|
To update this thread for anyone who comes across it in search... Turns out the problem was with the difference between 32 and 64bit geoprocessing. 10.1 SP1 supports 64bit background geoprocessing. If the custom traffic provider is only registered with the 32bit esriregasm.exe, then it will only work in 32bit GP. Registering using the 64bit esriregasm allows custom DLLs to work in 32bit Desktop and GP, along with 64bit Server and background GP.
... View more
05-23-2013
07:04 AM
|
0
|
0
|
1165
|
POST
|
The first - is a service area analysis in network analyst 'dynamic' when configured with historic traffic data? By that I mean, if we have travel times measured at intervals of 15 minutes, and I compute a service area of 60 minutes, does that mean network analyst will look to the travel times at 8:00AM, 8:15, 8:30, etc. as the trip progresses over the 60 minutes? Yes. Historical traffic is dynamic as you specify. If your service area leaves a facility at 8:00 am, if it arrives at an edge at 8:23 am, the travel times/speeds for 8:23 are used. Second - I have to create my own historic traffic data tables. In the help files it notes that you have the option of configuring historical profiles based on a percentage of travel speed versus free flow speed and values will be less than 0. Then it also briefly explains that if you are modelling travel times directly, values can be greater than 1, though it doesn't elaborate. As our edges have a travel time value measured in seconds, it looks like I don't have to convert everything to a proportion. Just not sure what network analyst will be looking for in terms of a value - if free flow is 100 seconds for example, and 8am is 120 seconds, would that make the value for the profile at 8AM 20 seconds (120-100)? Or will it be looking for 1.2 (120/100)? If it assumes it is getting a proportion, my value of 1.2 would indicate the link is faster than free-flow. Perhaps I should just make my life easier and go with proportions of free-flow. The value in the Profiles table is a scale factor, so it will be multiplied times your speed (or time, if you use that). If you are using speeds, for example, and your base speed is 100 KPH, then a value of 0.9 will give that road a speed of 90 KPH for the duration of that time segment. If you are using time, and your time is 2 minutes, then a value of 1.2 will give that road a time of 2.4 minutes. So, whether you use time or speed, the value in the patterns table is always a multiplier. If you want to slow down speed, use a value between 0 and 1. If you want to slow down travel time, use a value greater than 1. Does that help?
... View more
05-09-2013
07:33 AM
|
0
|
0
|
191
|
POST
|
Hierarchy will work across multiple source feature classes. What is called the "logical network" is built based on all of the sources. It doesn't matter which line sources make up your edges, in the logical network it is all one big edge type. But, once you have built your hierarchy, you might not see differences between exact and hierarchical routes. Perhaps another solution could be to use historical traffic to scale down the speeds of your local roads during high traffic times of the day. Or to add global turn delays for intersections at the local road (to slow down for stop signs or traffic lights). Not perfect, but those options are closer to how road speeds actually behave.
... View more
05-09-2013
07:16 AM
|
0
|
0
|
208
|
Title | Kudos | Posted |
---|---|---|
1 | 04-14-2015 07:46 AM | |
1 | 07-31-2015 09:09 AM | |
1 | 04-10-2013 06:58 AM | |
2 | 02-14-2018 03:51 PM | |
2 | 02-14-2018 02:20 PM |
Online Status |
Offline
|
Date Last Visited |
10-19-2021
04:18 PM
|