Importing ASCII raster files

11-03-2016 01:20 PM
New Contributor

Hi, I am trying to create maps based on ASCII raster files but so far I have not even been able to figure how to start. Any tips welcome, also open to suggestions. I will be happy to convert to raster or shape as long as I can open them in my app.

My input .asc files look like this

ncols 1456
nrows 800
xllcorner 197168.912300
yllcorner 11996496.877200
CellSize 1000.000000
Nodata_value -9999
row 1
row 2
row n

0 Kudos
3 Replies
Esri Frequent Contributor


In the current v10.2.X release we don't have a specific raster data type or layer to handle these, you'll need to use the Local Server and a Geoprocessing Package to convert the ASCII raster into another raster format and then use the result map service to render that. In the upcoming v100.0 release we have added a raster layer which can reference raster files on disk. Here's the list of supported types: Add raster data—ArcGIS Runtime SDK for .NET (Quartz Beta) | ArcGIS for Developers.

If your app regularly has data coming in in ASCII format then you can still use the LocalServer to convert to one of the supported types above.

For more info on the Local Server see Work with local services—ArcGIS Runtime SDK for .NET | ArcGIS for Developers 



0 Kudos
New Contributor


I download and installed Quartz Beta and followed the provided examples, but was not able to figure out how to load and display the ASCII raster file. In the desktop app that I am working on, I would like to load ASCII raster files, allow the user to make some changes (after converting to shapefile) and the re-save as ASCII raster to be processed by another system. Do you think that ArcGIS Runtime SDK (production version or Quartz) will be able to accomplish this tasks?

0 Kudos
New Contributor II

I do something similar using KMZs and no Quartz, but the whole thing is a bit messy. Basically I import the ASCII into a List<List<double>> matrix, convert it to a png, create an associated kml based on the ASCII header, zip the whole thing into a kmz file and import it to arcgis .NET as a kml overlay layer. Once you have the overlay you can control the user events on the map to modify the actual matrix and repeat the operation again to update the output. At any time you can save the data into an ASCII file by simply adding the initial header and the backup matrix you are using into a txt file.

0 Kudos