POST
|
Custom evaluators work on network elements (e.g. edges), as such source feature field values are not directly accessible, but a network descriptor attribute that accesses source feature field values can be used instead. In your case it looks like you have an attribute called Field_Type that you want to use in the custom evaluator. And I think you want to be able to pass in a value to use as the priority type. Step 1 - Update the network dataset - open the network dataset properties - go to Travel Attribute > Descriptors - add a descriptor attribute that reads the Field_Type attribute (e.g. naming it Field_Type_Descriptor) - re-build the network Step 2 - Update the custom evaluator code a) Add the init method with an argument for the priority type value def __init__(self, attribute_name: str, Priority_Type: int): self.priority_type = Priority_Type super().__init__(attribute_name) b) In the refresh method get the descriptor’s attribute index: def refresh(self) -> None: self.field_type_descriptor = self.networkQuery.attribute("Field_Type_Descriptor") c) In edgeValue use descriptor attribute index to get the field value: def edgeValue(self, edge: arcpy.nax.Edge) : base_value = self.networkQuery.attributeValue(edge, self.attribute) field_type_value = self.networkQuery.attributeValue(edge, self.field_type_descriptor) if field_type_value != self.priority_type: base_multiplier = 10 return base_value * base_multiplier else: return base_value Setup 3 - update the solving code When creating an EdgeCustomizer object pass in the cost attribute name that will be update and the value of the priority to use. priority_value = 5 # set the cost attribute to alter and the priority value to use ce_list = [EdgeCustomizer("TravelTime", priority_value)] network_dataset.customEvaluators = ce_list I've also attached an example script with the above and gdb where I added a Field_Type to the streets and a descriptor to the network dataset (the data is a small subset of the San Fransisco data in the Network Analyst Pro Tutorial data). Tell me if this helps.
... View more
03-01-2024
04:01 PM
|
0
|
0
|
80
|
POST
|
Hi, You don't really turn a route tracker object on or off rather, a location data source can pass new locations to a route tracker object. Is is the location data source that is turned "on" or "off" If you use the RouteTrackerLocationDataSource it takes a route tracker object and a "base" location data source, then internally new incoming locations from the location data source are passed to the route tracker via the TrackLocationAsync method. The same is true if you used your write your own custom location data source class (vs using the RouteTrackerLocationDataSource), but in that case you'd explicitly call the TrackLocationAsync method. So to "stop" the route tracker you'd stop the base location data source. So for example you can call the map's location display and set "isEnable=False", but if you want to still see the blue dot you'd have to reset the map's location display to a location data source object and enable it. Examples // stopping the location data source will stop the route // tracker from getting new locations and remove blue dot MyMapView.LocationDisplay.IsEnabled = false; // stopping the location data source will stop the route // tracker from getting new locations, so to still show a // blue dot set the location data source on the map MyMapView.LocationDisplay.IsEnabled = false; MyMapView.LocationDisplay.DataSource = new SystemLocationDataSource(); MyMapView.LocationDisplay.IsEnabled = true; Frank
... View more
05-02-2023
05:37 PM
|
0
|
0
|
329
|
POST
|
are you using the travel modes that "came with" custom roads or did you add a new one or alter an existing one? what version of custom roads are you using and which region? maybe try setting these to false one at a time to see that narrows down the cause routeParameters.setReturnDirections(true); routeParameters.setReturnStops(true); routeParameters.setReturnRoutes(true);
... View more
11-09-2020
01:27 PM
|
0
|
0
|
580
|
POST
|
Couple questions ... 1) Are the above x,y's are in State Plane? If so which zone, etc. If not what coordinate system are they in? 2) If you look at the network data set feature with the above points do they "overlap" Frank
... View more
05-20-2020
12:12 PM
|
1
|
0
|
632
|
POST
|
Hi, I think perhaps the network data in the mobile geodatabase data got cutoff when it was created. Below is what I see (with inc and fac from service on top) when I use the forester data that was attached (and drawing the roads)... some of the inc and facs are in areas with out a network features Since it is a straight line at the bottom ... I suspect that in ArcMap when running the Create Runtime Content tool when it did the "Analyze" another window is result opened but that changed (reduced) the visible map extent, there by cutting off the bottom portion. If that is the case just re-create the data but make sure when tool, after the analysis window open,you see all the data you want to include in the map view.
... View more
05-17-2020
09:03 PM
|
2
|
1
|
1442
|
POST
|
Just to note the mobile map package tool is only in Pro (not ArcMap).
... View more
05-15-2020
04:32 PM
|
2
|
1
|
1442
|
POST
|
When creating a mobile geodatabase that has a network (from a FGDB) a "tn" folder which contains the transportation network data should be created also. For example the one you mentioned from esri (san diego) you need to copy both the san-diego-network.geodatabase and the san-diego-network.tn folder to the device location. So I suspect the same is true your data (forester.geodatabase) since the zip attached also did not have the "tn" folder. Note, if you have ArcGIS Pro, and are working with 100.x of the ArcGIS Runtime you can also use the create-mobile-map-package to create an mmpk.
... View more
05-15-2020
03:00 PM
|
2
|
6
|
1442
|
POST
|
Presently the 100.x route task does not have that property when using local data, for services it will use the "Ignore Invalid Locations" property on the service. For invalid stops you have do you know why they are not locatable? Are then just not near anything or is something with the data input? The snapping tolerance for locating of stops is 20 km so unusually it should be able to find something.
... View more
02-05-2020
03:28 PM
|
0
|
2
|
632
|
POST
|
Massimo, I believe the cause of the problem is that “Exclude route_ids” and “Exclude trip_ids” attribute parameters have NULL as there value. It looks like ArcGIS Runtime is not parsing the value correctly when the value is a NULL. I have logged an issue regarding this. But to workaround this for now ... if you don't need those parameters (i.e. you don’t want to exclude any GTFS routes or trips from the analysis) then you could just delete them. Alternatively if you do plan to use those in the future you could enter some dummy string value in there, I believe the evaluator should just ignore the dummy value.
... View more
05-14-2019
09:49 AM
|
0
|
2
|
882
|
POST
|
Does anyone know if it's possible to include a network dataset (routing) in a mobile map package and then access it via the MobileMapPackage qml type? I think the answer is no, but am looking for confirmation that I haven't missed anything. >>> In ArcGIS Runtime (all SDK's including Qt\QML) you can create a Route Task from a mmpk that has a map with transportation network. https://developers.arcgis.com/qt/latest/cpp/api-reference/esri-arcgisruntime-routetask.html The route task allows you to create routes from input stops. The high level step to work with a route task are: - Create a route task (from service\transportation network\.geodatabase) - Set route parameters (e.g. set stops, plus others as needed) - Call solve on route task passing in the route parameters - Deal with solve result The closest I could come to was that a Map object has a property transportationNetworks , which is a list of "TransportationNetworkDataset" objects, which I think are referring to network datasets? >>> When a network dataset is packaged in Pro into mmpk it is converted into what we call a transportation network. We refer to them by different names because they have a different internally structure, and there are a few features that are supported in a network dataset that is not supported in a transportation network. Pro seems to have limited tools yet for creating network datasets and I haven't even been successful in getting a network dataset into a map in Pro, let alone a mobile map package. So I'm trying to save myself from time spent getting that to work if I can't then even use it in the runtime. >>> You can add a network dataset to a map in Pro from a existing GDB or SDE, but Pro does not yet allow you to create a network dataset. To create an mmpk for routing in runtime you need to, in Pro, add the network dataset (e.g. Streets_ND) from a fgdb\sde to a map (plus any other data you want in the mmpk) then convert the map to a mmpk. The network dataset will be Then in runtime you need to - open the mmpk - load a map from the mmpk - get the transportation network from the loaded map (map must be have been loaded) - create the route task the transportation network General MMPK help http://pro.arcgis.com/en/pro-app/help/sharing/overview/mobile-map-package.htm Gdb with example network dataset data that can be used to packing into a mmpk: http://www.arcgis.com/home/item.html?id=d6bd91b2fddc483b8ccbc66942db84cb Sample at url below uses a routing service to create a route task, to use mmpk you can use the constructor for the task that takes a transportation network (acquired from a loaded map) ... "RouteTask::RouteTask(TransportationNetworkDataset *transportationNetworkDataset, QObject *parent = nullptr)" https://developers.arcgis.com/qt/latest/qml/sample-code/sample-qt-findroute.htm
... View more
01-24-2019
09:39 AM
|
0
|
0
|
482
|
POST
|
Looking at the tcpdump output the REST call is sending "outputGeometryPrecision = 1000000", this is the reason for the divergence between the map and route. What I'm not sure about how the REST call has this when code has outputGeometryPrecision=1; You said "when i install my app on Android phone and I select very the same route, route line is drawn correctly.", exact what is your setup\development environment when you get the problem? Thanks
... View more
05-08-2018
09:28 AM
|
1
|
6
|
1692
|
POST
|
It looks like the route is being generalized, the world routing service by default has the geometry precision set to 10 meters, but your code explicitly sets this property " routeParameters.travelMode.outputGeometryPrecision=1 " so it is unclear as to why the route would be be generalized. I looked at the examples above, even using the default of 10 m the output route does not have the those those large divergences from the base map. I had to set the outputGeometryPrecision to 100 and 200 m to get anything similar. Not sure where you are doing the initial development but if you can capture the web request to the world routing service it should have the values for the outputGeometryPrecision that is being used (and the outputGeometryPrecisionUnits). That would show what the rest call is actually using for these values.
... View more
05-04-2018
03:59 PM
|
1
|
8
|
1692
|
POST
|
Hi, I used the aa.mmpk you attached above and added it to my iPhone via iTunes. It was listed in my available "Maps" and I was able to open and route with it. So it seem like the mmpk is 'valid'. What type of device are you using? And what steps did you follow to put it on the device? Thanks
... View more
11-27-2017
09:26 AM
|
1
|
0
|
398
|
POST
|
var mapPackage = await MobileMapPackage.OpenAsync("C:\\Program Files (x86)\\Common\\Maps\\NetworkPackage.mmpk"); //add this line and the TransportationNetworks[] should no longer be null. await mapPackage.Maps[0].LoadAsync(); if (mapPackage.Maps[0].TransportationNetworks != null) Alternatively .... you might want to display the map from the map package this will (auto) load the map [e.g. myMapView.Map = mapPackage .Maps[0];] Then you could monitor the status of the map (whether is loaded or not) by hooking up the the map's loaded event (e.g. myMapView.Map.Loaded += Map_Loaded;), and in the 'Map_Loaded' method you could now use the TransportationNetworks[]. So the general structure would be something like this (note: this is just one possible way): MobileMapPackage mapPackage = await MobileMapPackage.OpenAsync(mmpkPath); MyMapView.Map = mapPackage.Maps[0]; //connect up load event MyMapView.Map.Loaded += Map_Loaded; } private void Map_Loaded(object sender, EventArgs e) { //Use dispatcher since dealing with different threads Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(CreateRouteTask)); } private void CreateRouteTask() { // check if trans networks not null if (MyMapView.Map.TransportationNetworks != null) { //if not do something with them Console.WriteLine(MyMapView.Map.TransportationNetworks.Count); } }
... View more
05-30-2017
12:13 PM
|
2
|
0
|
544
|
Title | Kudos | Posted |
---|---|---|
1 | 05-04-2018 03:59 PM | |
1 | 04-01-2016 03:01 PM | |
1 | 05-08-2018 09:28 AM | |
1 | 11-27-2017 09:26 AM | |
1 | 12-03-2018 09:15 AM |
Online Status |
Offline
|
Date Last Visited |
2 weeks ago
|