POST
|
Obviously, Pro and MMPKs make this much easier, but I think there are a couple of options if you don't have access to ArcGIS Pro. Option 1: Create a preplanned offline workflow in ArcGIS Online for your area (https://developers.arcgis.com/qt/offline-maps-scenes-and-data/tutorials/create-an-offline-map-area/) and then download the map for offline use when the application starts up initially. The device can't be completely offline for this; you do have to let the user connect to network first so they can download the map area (https://developers.arcgis.com/qt/offline-maps-scenes-and-data/download-an-offline-map-ahead-of-time/) Option 2: If it's just the basemap that you want available offline, create tile packages (tpk) for the area you want and add them as your basemap in the MapView. I think the general workflow to follow is: 1. Pick the map service for the basemap you want tiles for. World Imagery, Topographic 2. Export tiles from basemap using REST API 3. Add tpk to MapView's operational layers.
... View more
10-27-2023
08:57 AM
|
0
|
0
|
1142
|
POST
|
ArcGIS Maps SDK for Qt has several options for offline workflows depending on your specific scenario. See here: https://developers.arcgis.com/qt/offline-maps-scenes-and-data/ I think you might want to look into how to generate Mobile Map Packages (mmpk) and how to use those in the application. See here for more info: https://developers.arcgis.com/qt/tutorials/#offline
... View more
10-26-2023
06:19 AM
|
0
|
2
|
1164
|
POST
|
@DiveshGoyal Any idea why the CreatePointAlong() method uses planar distance to calculate? I want to use geodetic distance and tried reprojecting my data from wkid:3857 to wkid:4269, but no success. I made a post here. If you have any insight, I'd appreciate it! Thanks!
... View more
09-03-2023
03:38 PM
|
0
|
0
|
728
|
POST
|
I'm using the .NET Maps SDK and GeometryEngine to calculate x distance (in miles) traversed along a polyline and drop a point there. I'm using the CreatePointAlong() method to achieve this. However, when I run this, I get a resulting point that is measured using planar miles. I want this distance to be measured using geodetic miles. How can I achieve this? My polyline that's being used for the calculation is in Web Mercator (WKID:3857) which is a projected coordinate system with units in meters. Could this be the reason for why the distance measurement is planar? Here's the WkText for my polyline's SpatialReference: "PROJCS["WGS_1984_Web_Mercator_Auxiliary_Sphere",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Mercator_Auxiliary_Sphere"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",0.0],PARAMETER["Standard_Parallel_1",0.0],PARAMETER["Auxiliary_Sphere_Type",0.0],UNIT["Meter",1.0]]" What else have I tried? I tried reprojecting the polyline to NAD83 using SpatialReference.Create(4269), but this changed the unit of the polyline to degrees. I need to use miles in my distance measurement, so I believe this is useless. And finally, I know the resulting point is calculated using planar and not geodetic distance because I compared with ArcGIS Pro's Measure tool which lets me measure using planar and geodetic methods. Any help would be appreciated! Thanks!
... View more
09-03-2023
03:30 PM
|
0
|
0
|
874
|
POST
|
What I'm trying to solve: I want to calculate the distance traversed along a line feature from a point that's on the line. The line features split and contain branches (think river stream) at irregular intervals. I want to solve this problem using .NET Maps SDK in .NET MAUI, using locally stored data from an MMPK. I have a network dataset that contains this data, so I can use the Network Analysis namespace. Our client has a python script that uses arcpy to create a route event layer from a service area layer to perform this task. The route events that get created are the point locations that I'm trying to recreate in my .NET application. What I have tried so far: In this network dataset, I have point "facility" features and line "network" features. With this data, I have created ServiceAreaTask and I'm able to map ServiceAreaPolygons on the map. There is no equivalent of "Create Route Event Layer" in .NET Maps SDK, so I do a couple of things to achieve the same effect (or so I thought). First, I take the ServiceAreaPolygon, create a boundary around the polygon, and see where the line feature in question intersects with the polygon boundary. I figured that since the extent of the Service Area Polygon matches with the impedance cutoff, the boundary on the line should be where the event is. Now, this works only ~ 50% of the time. ServiceAreaPolygons are created in what seems like, erratic and random places, in areas where there's no data. This gives me extra, incorrect point locations. In other cases, I also end up with less points than I should. Suffice it to say that what I am trying to mimic CreateRouteEventLayer does not work. Anyone have any idea on what's really happening behind the scenes of CreateRouteEventsLayer that I can also de-construct and apply using .NET Maps SDK? I'm also looking into CreatePointAlong() method in GeometryEngine, which would work in some cases, but not all, I think. Not sure how it can handle branch-offs and splits in a polyline. Thanks in advance!
... View more
07-19-2023
12:26 PM
|
0
|
0
|
403
|
POST
|
Thank you @DiveshGoyal for your reply. After deliberating over this, and trying out a first-pass implementation of NetworkAnalysis, I think it's becoming clear that I do need to use CreatePointAlong(). I can't believe I missed this while searching in the Geometry class docs. Apparently, I should've been checking the GeometryEngine docs instead!
... View more
07-19-2023
08:16 AM
|
0
|
0
|
824
|
POST
|
Hi @mprogers , You may want to check if the application can detect your file. Use something like this to check if the file exists: var mmpkLocation = System.IO.Path.Combine(Environment.CurrentDirectory, @"data/MahouRivieraTrails.mmpk");
MMPKExists = File.Exists(mmpkLocation); Note that in my case, the file is located within the data directory. Also, in your post, you said this: The instructions are to just drag the mmpk file into the project, and set Build Action to Compile, I've done that. I don't think there's a build action called "Compile". Do you mean Content? You can also check the .sln file in Visual Studio's Solution Explorer to see if the mmpk is added there. Double click on the project in Solution Explorer, and you'll see the .sln file open. Search for instances of "mmpk". You should see something like this. <ItemGroup>
<Content Include="data\MahouRivieraTrails.mmpk" />
</ItemGroup>
... View more
07-07-2023
06:45 AM
|
0
|
0
|
804
|
POST
|
Background: I have a .NET MAUI Application that I'm building for iOS devices. The application uses an MMPK for offline data storage, so whatever solution I implement to this problem must utilize MMPK data or coexist with it. Problem: I have a dataset consisting of lines (>11,000 features) and points (>2500) that intersect those lines. See a sample of what this data might look like: I want to be able to calculate the distance traversed from any given point feature along a line feature, respecting direction. So, essentially, what's the point on "brown" line feature that is x distance away from "green" point that intersects with this line? My attempted solution: Create network dataset and build it in ArcGIS Pro. Then add feature dataset containing ND to MMPK. In the app, create a ServiceAreaTask from transportation network dataset from the MMPK. Add ServiceAreaParameters, where I set my "green" points as facilities, and add default impedance cutoffs to distance x. Solve Service Area of facilities. Get my point outputs on the line features from this result. I'm stuck at the part where I'm creating my ServiceAreaTask with the transportation network dataset, after realizing that I probably should be creating a network dataset with just the single line segment in question, instead of ALL the line segments. Am I correct in my assumption here? If I create a network dataset with all my line segments, then the calculation for the shortest route along any single line segment will be compromised by other intersecting lines. Instead, for this to work, I need to create network datasets on the fly from the line segment in question. But as far as I know, there's no way to do this in .NET Maps SDK. I need a transportation or utility network to start the ServiceAreaLayer task, but the only way to create this is external to the SDK. So, how can I fix this problem for use in my MAUI application? Can I still use Network Analysis? Or do I need to come up with my own version of calculating distance traversed along line segment? Please tell me I don't have to implement Djikstra's algorithm to solve this in .NET 😶 Thanks for the help!
... View more
06-13-2023
07:54 AM
|
0
|
3
|
942
|
POST
|
Thank you for your response @PreetiMaske. Your explanation and me tinkering around with geodatabases inside mobile map packages made me realize what I was doing wrong. I was using a standard geodatabase in my app bundle and trying to access that without success. But once I started using a mobile geodatabase (.geodatabase extension not .gdb), MAUI is able to recognize the file and I don't get the above "Permission Denied" error anymore, which was prompted by me trying to open a .gdb, which is a directory and not a single file. In this scenario, I would add the .geodatabase to the .csproj file and not the .gdb "directory". This resolves my initial confusion well, so thank you and @dotMorten_esri !!
... View more
06-09-2023
02:26 PM
|
0
|
0
|
2397
|
POST
|
Great! Thanks @dotMorten_esri for your explanation. So after adding the .gdb as a MauiAsset, I ran the following suggested code edit which sets up the gdb to be streamed. string databaseLocation = Environment.CurrentDirectory + @"/Data/gdb/FT_data.gdb";
using var fileStream = FileSystem.Current.OpenAppPackageFileAsync(databaseLocation); I'm developing this application primarily for iOS devices, and while running the following suggested code on iOS emulator from Visual Studio, I'm getting a System.UnauthorizedAccessException Error saying Permission to the gdb is denied. I think this is very likely to do with not setting up provisioning profiles for development. I'll be digging into this further... But here's a related question. Let me know if I should start a separate thread to get answers for it. Is there a way to use an MMPK's network dataset instead of a .gdb? The documentation explicitly mentions a geodatabase, so wondering what my options are. I already use an MMPK elsewhere in my app, so I have no issue with MAUI recognizing it, just need to know how to prep it for Network Analysis.
... View more
06-08-2023
03:34 PM
|
0
|
2
|
2410
|
POST
|
I have a .NET MAUI app in which I'm trying to create a network service area analysis task using a local geodatabase's network dataset. See here for docs. The geodatabase exists directly in the code directory inside a Data assets folder (Project/Data/FT_Data.gdb). My eventual goal is to use an MMPK that I download from a non-Portal, non-AGOL network server that contains the network dataset in question. But for now, I'm starting off trying to feed the local gdb in. This is where I'm running into issues. See code below: string dbLocation = System.IO.Path.Combine(Environment.CurrentDirectory, @"Data", @"FT_data.gdb");
ServiceAreaTask serviceAreaTask = await ServiceAreaTask.CreateAsync(dbLocation, "network"); The application crashes at Line 1 here, because it cannot find the geodatabase at this location. I know this logic generally works at finding other files, since I've tried the same line with an MMPK that exists, and it can find it no problem. The issue results from not being able to set the build action for a geodatabase in Visual Studio's Solution Explorer pane. With an MMPK or other files, I can set the Build action to "Content" and it will work. But for a geodatabase that exists as a directory in Solution Explorer, I don't want to go in and set the build action for each of the binary files. So, there you have it. How can I reference a local geodatabase that already exists? I'm trying to do a pretty simple task that the .NET Maps SDK tells me I should be able to. But the only examples I could find are gdb downloaded from ArcGIS Enterprise Portal or Online and then stored in a folder outside the code. Thank you!
... View more
06-07-2023
10:06 AM
|
1
|
4
|
2474
|
POST
|
I uninstalled the Pro SDK and related extensions from Visual Studio, restarted my machine and tried running the same script from Powershell. Much to my surprise, this gives me the same error. I still have Pro installed.
... View more
04-02-2023
02:58 PM
|
0
|
8
|
1385
|
POST
|
I will try to find some time in the next couple of days to do this @ShaunWalbridge . Before I uninstall the Pro SDK, I need to tie up a few loose ends in the Pro SDK project I'm working on 😅
... View more
03-22-2023
07:48 AM
|
0
|
10
|
1465
|
POST
|
Does downgrading to Pro 3.0.x solve the issue? I'm hesitant to go through the effort so far until I know this can solve it for sure
... View more
03-22-2023
07:43 AM
|
0
|
0
|
1467
|
POST
|
Hi @ShaunWalbridge , Thank you for your reply. Testing further, this issue can be replicated for me in Powershell, Command Prompt or any other shell. If I can start python in the shell, then import arcpy and run any command that requires a filepath, the above error is produced. I do separate work with the Pro SDK for .NET and some other Maps SDK for .NET projects, but I don't use console or shell for them, if that answers your question. Thanks!
... View more
02-27-2023
04:21 PM
|
0
|
1
|
3222
|
Title | Kudos | Posted |
---|---|---|
1 | 06-07-2023 10:06 AM | |
1 | 07-22-2022 02:17 PM | |
1 | 02-26-2023 08:27 PM | |
1 | 02-17-2023 02:37 PM | |
1 | 04-05-2022 09:38 AM |
Online Status |
Offline
|
Date Last Visited |
2 weeks ago
|