I am surprised to find that ArcGIS runtime only supports a very limited set of raster formats: Add raster data—ArcGIS Runtime SDK for .NET | ArcGIS for Developers
Supported raster formats
ArcGIS Runtime supports a subset of raster file formats that ArcGIS Desktop supports. The raster file formats ArcGIS Runtime supports include the following:
- DTED0, 1, 2
- JPEG 2000
- MrSID, generations 2, 3, and 4
- RPF (CIB)
- RPF (CADRG)
- SRTM1, 2
- Mobile mosaic datasets
I'm trying to import an ASCII grid format Esri ASCII raster format—Help | Documentation
Which is basically an ascii text file, which looks like:
NCOLS xxx NROWS xxx XLLCENTER xxx YLLCENTER xxx CELLSIZE xxx NODATA_VALUE xxx row 1 row 2 ... row n
Having a brief look around, I find only a few threads of help. :Importing ASCII raster files
Which I'm a bit confused about... It is not possible to process a conversion in memory, or is the only way currently to convert the file and open the new converted file, as this would seem terribly inefficient.
Is there no way to create a raster object and pass it the memory, and use something else to actually load these files?
The answer might depend on your workflow, or that of your users e.g. Is this a one-time import of raster data into another format or do users of your app regularly open ascii rasters from disk?
If you're building an app with WPF then you could use the ArcGIS Runtime Local Server. This will support all the raster formats of ArcGIS Pro / ArcMap. You could read/render the dataset from disk via a LocalMapService or use a LocalGeoprocessingService to import/convert the raster data between formats.
Thanks for your reply.
I think there will be two main questions/uses I'm thinking of: the first being that we will often need to load the ASCII formats, and the second I'm considering an animation by showing a number of raster one after another, for which I have the data in memory, and again it would seem fairly inefficient to send it to the disk only to be reloaded.
I'm currently using an encapsulated WPF form within my .NET windows forms app; which intend to migrate up to WPF at some point soon. Having a bit of look around ArcGIS Runtime Local Servers, and LacalMapServices, and LocalGepprocessingServices doesn't look too simple; Could you give a quick example for the purpose of 1. loading an ASCII file 2. passing data?
So I found a work around for the time being, whereby for loading the ASCII, I'll just use GDAL to convert it to a GeoTiff format. Although this seems terribly inefficient.
For the animation, that would be even more inefficient it would seem.
I had a quick look at the LocalServer and LocalMapService, but this would seem you need to have users install and run the separate program that is the LocalServer? Is this correct?
Is no way to pass it the data, if I've already loaded them with something else like GDAL, or lets say generated them?
The latest release (100.8) added support for 'animation' of raster data in the 3D scene view with Image Overlays. Bringing that to the 2D map view is on the roadmap for a future release.
Regarding Local Server, that's an additional component/SDK that you as the developer install on your dev machine and incorporate the capabilities into your app then you include the Local Server pieces you need when you deploy the app to your users.
How many raster datasets would you like to animate and what's the image size approx?
Thanks for your continued support Michael Branscomb
It would seem that 'animation' presumes you have all the images before the animation begins...
In actual fact, I have a flood modelling system, for which I'd like to show the outputs, and because of this I won't have the rasters until they are produced by the model.
Thanks for clarifying the localServer a bit more. Would the local server be able to load the the ASCII files into data and pass that to the map, which would be quicker and more effecient than converting them with GDAL.
I'm still trying to get the colours right in another post, but again because this will be model output, the size and number of rasters could vary. Although the number of rasters, would mainly depend on what the system can push through in a given time, thus my questions of the efficiency of loading/converting/passing data etc.
The Local Server component provides a wide range of functionality and a lot of flexibility through geoprocessing services that execute python scripts. But with that comes the overhead of hosting and executing the local service which may not be significant but does mean it's typically not as fast as executing functionality that is entirely within the API / client-side (good examples being the visual analysis and image overlays which are highly optimized API-level features).
Local Server may be an option for you though - it broadly supports the same range of raster formats as ArcGIS Pro (because it's built from the same codebase): Raster file formats—ArcGIS Pro | Documentation.
Do the raster datasets have a time aspect to them?
Thanks again Michael Branscomb
Yes the rasters do have a time element, as its a flood scenario. Although at present I'm mainly worrying about creating the animation through a series of time slice rasters.
So can the LocalServer (or maybe LocalMapService) pass the data to the map for the purposes of such an animation?
I don't supposed you could provide some code snippets to do this relatively simple procedure?
I guess I'll need at how to implement the local server/local map service to do this.