2

I have a raster which is stored as a .lyr file, which I got from the following source:

http://forestrymaps.alaska.gov/arcgis/rest/services/Rasters/AK30mSlope/MapServer

When I open it in ArcMap I cannot seem to perform any Raster based analysis, as I get an invalid GP data type error - and I can't even open it in QGIS. I am essentially trying to convert it to a raster format in order to perform raster statistics (zonal statistics in ArcMap or raster <> polygon statistics in QGIS), however neither program recognises it as a valid raster, perhaps because it is lyr file. The link above also allows you to generate it as a KMZ file, however I haven't had any luck trying to utilise this or the contained KML file either. The link does let you export an JPEG or PNG file directly, however after playing around with the parameters I could not get the output to the desired level of quality/resolution.

How might I use this data for raster analysis?

In it's current format it seems I can open it in ArcMap to view it, but not much else.

I also tried to find the data source the .lyr file is pointing to using a python script I found in my searching, however the file does not seem to be a feature class, apparently, so I could not get the source.

  • 1
    I don't think you will be able to do anything with either of those (.lyr or kmz) they are simply pointing to the feature service. You don't actually have the data which is what you need. You'll be better off downloading elevation data from the National Map and creating a slope layer on your own. – jbchurchill Nov 13 '19 at 19:07
2

A) A LYR file is not a datastore, it is a pointer to the actual data (with symbology and other display rules). So what you have saved as your LYR file is a pre-defined connection to that data on the Alaska Forestry Service's ArcGIS MapServer instance.
(http://forestrymaps.alaska.gov/arcgis/rest/services/Rasters/AK30mSlope/MapServer)

B) In order to use this data for raster analysis, you will need to save/export the data in either ArcGIS or QGIS. Instructions below will be for QGIS:

1) Create a new connection for an ArcGIS MapServer instance using the Data Source Manager
enter image description here

1A) Setup the connection as depicted below, using this service link
http://forestrymaps.alaska.gov/arcgis/rest/services/Rasters/AK30mSlope/MapServer
enter image description here

2) Connect to the MapServer, and add the AK30mSlope layer, accepting defaults as shown
enter image description here

3) Ensure your project is in the correct CRS (EPSG:3467), and zoom to the proper extent for your analysis. I've chosen an extent at random (roughly 1:24k at Akwe Lake)
enter image description here

4) Export the extent to a GeoTIFF using the Convert Map To Raster Processing Algorithm. Be aware of the need to properly set the extent to render as well as the desired spatial resolution (map units / pixel). I chose a 256px tile size as that is typical for tiled image services. enter image description here

5) Re-add the exported data back to your project, and use it as the source for further analysis.

  • Thanks, I did try exporting the map already - I have now tried again, with ArcMap and QGIS. With QGIS, the different blocks of the image appear scrambled in the exported image for some reason. Using ArcMap, the image quality is significantly reduced and fuzzy compared to what appears in the original map, making it unusable for statistical raster analysis. This was when using 300dpi or even 3000dpi, using TIF or JPEG format. I'm not sure if this could be controlled by some other setting I haven't accounted for, or if it is simply the result of the resampling method used to generate the image? – jalpaca Nov 15 '19 at 18:12
  • There should be no difference in input and output data when done as I've described above using QGIS, as I've used this method numerous times to perform spectral analysis on web layers. Something else must be going on. Please attach your exact settings for export from QGIS (and be certain you're using the latest version [3.10]) – Saijin_Naib Nov 15 '19 at 18:23
  • Give the "Convert map to raster" Processing Algorithm a go instead of the way I quoted above. I'll be changing my answer to reflect this, as I believe this way to be more intuitive. – Saijin_Naib Nov 15 '19 at 19:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.