|
POST
|
Hello, Murali! Network parameters are created as NetworkAttributeParameter objects and accessed via INetworkAttributeParameter. You will need to set up an IArray of parameters for the network attribute that you want to parameterize. Then you apply the IArray to the parameters setter of your attribute. As for the VarType property of the parameter, here is a list of the int values you should apply for a given parameter type: VT_EMPTY = 0, // uninitialized VT_NULL = 1, // null VT_I2 = 2, // short VT_I4 = 3, // int VT_R4 = 4, // float VT_R8 = 5, // double VT_DATE = 7, // DateTime VT_BSTR = 8, // string VT_BOOL = 11, // boolean VT_UNKNOWN = 13, // object VT_ARRAY = 0x2000 // array If something here is unclear or doesn't work, please ask more questions. Thanks and good luck!
... View more
05-23-2012
07:09 AM
|
0
|
0
|
499
|
|
POST
|
Hello! The FindBestSequence property of INARouteSolver is what activates the Traveling Salesperson Problem algorithm in the solver. Once TSP is active, you set INARouteSolver to PreserveFirstStop and/or PreserveLastStop to force the solver not to resequence the first and last stops. For example, if you want a route to start at your home, visit a few stops, then return to your home, you would add your home as the first and last stop in the Stops class, then set both PreserveFirstStop and PreserveLastStop to true. Setting up the route solver in ArcObjects can be seen in a few different samples: Here is some ArcObjects code for setting up, solving, and saving a Route analysis. Here is a sample that uses the Closest Facility solver, but has some UI elements, to help you along with the interface. Here is the NAEngine application that works like a mini-standalone version of ArcMap, complete with an NAWindow, etc. Here is a sample that opens a network dataset, creates a Route layer and saves it out to disk. If you have any issues using the samples, just ask a question here and I'll help you work it out. Good luck!
... View more
05-21-2012
07:33 AM
|
0
|
0
|
456
|
|
POST
|
The evaluator has been posted here: http://www.arcgis.com/home/item.html?id=72ef24542857413c8981f2e196f1bb13 Please use it and send me any feedback you may have (or post here to help everybody). Thanks!
... View more
04-25-2012
06:59 AM
|
0
|
0
|
712
|
|
POST
|
Hello, Kyle! You are correct that the results in ArcMap and the results in the CSV generation executable should match. Is it possible for you to share your network dataset and the layer file you are using as input? I would like to reproduce and debug the problem. Thanks
... View more
04-02-2012
10:23 AM
|
0
|
0
|
512
|
|
POST
|
The various violated contraints can be found here: http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/esriNAViolatedConstraints_Constants/003600000014000000/ You need to do some bitwise arithmetic to figure out which combination of constraints are violated. In your case, you have 37 or 61. For 37 (000000000100101): esriNAViolationHardTimeWindow - 32 esriNAViolationMaxTotalTime - 4 esriNAViolationMaxOrderCount - 1 For 61 (000000000111101): esriNAViolationHardTimeWindow - 32 esriNAViolationMaxTotalDistance - 16 esriNAViolationMaxTotalTravelTime - 8 esriNAViolationMaxTotalTime - 4 esriNAViolationMaxOrderCount - 1
... View more
02-21-2012
06:07 AM
|
0
|
0
|
1912
|
|
POST
|
Hello, Jan! What network dataset are you using? Is your data small enough to zip up and post here? If so, please post it along with a screen shot or MXD that has where your start and destination stops are located. Otherwise, what type of connectivity policy are you using (any vertex or end point)? Also, you mention that there are no "other restrictions". Just to clarify, this means you have no turn restrictions, oneway restrictions, or anything like that? Do you have hierarchy enabled? If so (or if not), try the other setting and see if you get different results. To do a little debugging, you could try to use the Network Identify tool (on the Network Analyst toolbar), to step along the route and make sure that the network has the connectivity you expect build into it for that area. All of that is a good start. We'll work it out until we figure out what went wrong. Regards, Patrick
... View more
02-16-2012
05:59 AM
|
0
|
0
|
382
|
|
POST
|
Another option could be the Integrate geoprocessing tool. If you have two crossing polylines, it will add a vertex to each polyline at the point where they cross. In creating network datasets for Network Analyst, we use it to establish connectivity between road features.
... View more
01-27-2012
05:45 AM
|
0
|
0
|
594
|
|
POST
|
Hello! I see that you haven't had a reply to your query yet. You might have better luck reposting this on the geocoding forum.
... View more
12-14-2011
06:54 AM
|
0
|
0
|
354
|
|
POST
|
You are venturing out of my area of expertise, but I'll try to point you in the right direction. - After running the algorithm and find a shortest route, how can I draw the route on map so that user can easily regconizes that route. I found out piece of code in C#. Can I do the same with Java (I use ArcEngine 9.3) http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/RoutingForm/00480000014m000000/ To draw the route on the map, you will need to have tracked the edges that you have in your solution. Here is some code that will help go from an elements EID to getting the source feature underlying it: http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/How_to_access_source_features_referenced_by_a_network_dataset/00010000036r000000/ Once you have your set of source features, it is up to you on how to store it and display it. It is probably more trouble that worth it to set up your work as a custom solver with its own network analysis layer that can be used to display results. In your case, you can take the street features (and optionally, the junctions and turns) and output them as a feature class to a either a workspace on disk (FileGDB, SDE, SHP) or to an in-memory workspace. Then load the feature class as a layer in the table of contents of your map. Look around the Managing Data part of the SDK to find a way to manage your results. Not sure this is the best possible way, but in your shoes, I would first look into in-memory workspaces. Then, look into how to display data as layers in the TOC. If this link doesn't get you there, then look around that general area of the SDK for other options. - How I can let user choose a junction or an edge on a map by visually clicking on those elements (for example, choose the start point) Once you have the point on the map where the user clicked, you need to find the nearest network location. A good starting point would be this InArcMap portion of this SDK document about how to load points in ArcMap. I hope all of this helps. Also, note that anything you can do with .NET, you should be able to do with Java, with minor adjustments. That is why I link to the .NET SDK so much. It has a lot more information in it than the Java SDK.
... View more
11-28-2011
07:41 AM
|
0
|
0
|
815
|
|
POST
|
Try changing "Barriers" to "PolylineBarriers", like this: naWindow.ActiveCategory = naWindow.get_CategoryByNAClassName("PolylineBarriers"); Let me know if that does it.
... View more
11-23-2011
06:32 AM
|
0
|
0
|
1974
|
|
POST
|
I think your problem is that you are casting one of the sublayers of the NALayer composite layer as an NALayer. Using the Route layer as an example, a Route layer is a NALayer that can be cast as INALayer. The Route layer contains 5 sublayers called Stops, Routes, Barriers, PolygonBarriers, and PolylineBarriers. In your case, you are trying to cast the Lines Barriers class to an NALayer, when that class is only a feature layer that happens to be a sublayer of the Routes NALayer. So, as you iterate through the layers in your map, be sure to assign the full analysis layer to the ActiveAnalysis, instead of assigning one of the sublayers. Here is a bit of documentation about analysis layers: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//004700000034000000.htm
... View more
11-23-2011
05:33 AM
|
0
|
0
|
1974
|
|
POST
|
Do you have access to the ArcObject .NET SDK? If so install it and get one of the installed samples called NAEngine, also found here: http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/d/0001000000pw000000.htm This app shows how to use the ToolbarControl, TOCControl, and MapControl to do network analysis work. The Create Locations tool is already added to the toolbar, as is the button that opens the NAWindow. Once there is an active analysis layer in the NAWindow and one of the barriers classes selected in the NAWindow, you can make sure the Create Location tool is selected on the toolbar. At that point, you will be able to draw barriers appropriately. Hopefully, this gives you everything you need. At least, it is a great place to get reference code on how to program network analysis using the engine tools.
... View more
11-22-2011
08:28 AM
|
0
|
0
|
1974
|
|
POST
|
Just to make certain, your application is a stand-alone Engine application using Engine controls, correct? This is not designed to work within ArcMap. I need to look around and see if there is any further initialization to get the NA environment object to work correctly.
... View more
11-21-2011
09:18 AM
|
0
|
0
|
1974
|
|
POST
|
Sorry, I misunderstood your last post. You are looking for distance estimates to use as input to your A* algorithm? I'm not sure exactly how the measure tool works, but perhaps the results from there are using geodesic distance around the globe, rather than true straight lines from your pythagorean estimates. That could explain the discrepancy.
... View more
11-17-2011
12:34 PM
|
0
|
0
|
1925
|
|
POST
|
Thanks for your kind words. As to your questions, what network are you using? Does it have a length cost attribute? If so, you can query each edge directly to find out what its cost is using AttributeValueByName. To do this programmatically, follow these steps: Create a edge using INetworkQuery.CreateNetworkElement. Populate the edge your are interested in using its EID in INetworkQuery.QueryEdge. Then call AttributeValueByName, passing in the name of the length attribute. If the length attribute on your network is not in the right units, and your network is not readonly, you can change the units to the ones you desire. If you network is read-only, then you'll need to do some manual conversion.
... View more
11-17-2011
11:50 AM
|
0
|
0
|
1925
|
| 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
|