Access violation when routing with offline map

612
4
Jump to solution
07-10-2019 05:45 AM
RobrechtUlens
New Contributor

Hello,

When creating MapPoints to define stops for a route, I was under the impression that these would accept longitude and latitude coordinates. I tried to calculate a route using these coordinates and my application had a hard crash due to an access violation.

I figured out that I could convert from longitude latitude to mappoints using CoordinateFormatter.FromLatitudeLongitude(). This has solved my issue. I guess before it was trying to route between points that were not in the offline map package I was using. 

I thought I would let you know about this hard crash. Attached is a project that reproduces the issue. I am using 100.5.0 of the .NET SDK and I'm using the belgium.mmpk map which I downloaded from https://developers.arcgis.com/downloads/streetmap-premium-for-runtime. I also tried the 100.4.0 .NET SDK and got the same problem.

Kind regards,

Robrecht

0 Kudos
1 Solution

Accepted Solutions
RobrechtUlens
New Contributor

Hi Michael Branscomb

The issue is no longer reproducible with version 100.6.0 of the SDK.

Thanks,

Robrecht

View solution in original post

0 Kudos
4 Replies
MichaelBranscomb
Esri Frequent Contributor

Hi,

Thanks for the straightforward repro case. I've open an issue in our backlog and we'll investigate.

Cheers

Mike

0 Kudos
MichaelBranscomb
Esri Frequent Contributor

Hi,

This issue requires further investigation to determine the cause of the error and the appropriate resolution.

In the interim you can workaround this by specifying the SpatialReference of the Stop geometries you are creating:

e.g.

`List<MapPoint> coordinates = new List<MapPoint> { new MapPoint(50.9208595, 5.3386841,SpatialReferences.Wgs84), new MapPoint(50.9299484, 5.3944303,SpatialReferences.Wgs84) };` 

These specific coordinates will cause the SolveRouteAsync task to return an exception that you can catch. The exception message indicates that the Stops cannot be located on the network.

Cheers

Mike

RobrechtUlens
New Contributor

Hi Michael Branscomb

The issue is no longer reproducible with version 100.6.0 of the SDK.

Thanks,

Robrecht

0 Kudos
MichaelBranscomb
Esri Frequent Contributor

Hi,

Thanks for confirming.

Cheers

Mike

0 Kudos