Extract-by-Mask tool outputs a raster with noData values?

3011
3
04-23-2018 06:50 PM
ChathurikaMediwaththe
New Contributor

Hi,

I am using ArcMap 10.3.1 Desktop app.

I am trying to run ‘Extract-By-Mask’ tool on a raster dataset. The input raster is generated by running “Slope” tool on a DEM which I downloaded online. The input mask is a polygon shapefile which has area information of buildings.

When I run “Extract-by-Mask”, this produces the output raster with layer property values from -3.40282e+038 to 3.40282e+038 which means noData. Also, the output raster is not visible on ArcMap. Because of this reason, the next step in my code, which is “Extract-by-Attributes” on the output raster of “Extract-by-Mask”, gives me the following error in ArcPy,

“ERROR 010423: D:\Slope\slpbldg does not have valid statistics as required by the operation. Failed to execute (ExtractByAttributes).”

I have attached screenshots of the Python code I used to run Extract-by-Mask and the input (slpraw) and output rasters (slpbldg) as visible on ArcMap table of contents.

Not just with Extract-by-Mask, I also noticed that when I try to resample the original DEM to a different resolution (cell size(X,Y) from (0.0008333, 0.000833) to (1,1)) using the “resample” tool, the output DEM cannot also visible on ArcMap and has noData layer property values.

Can anyone help me out to resolve this problem?

Is this something to do with the original DEM? The original DEM has 20383 columns and 24013 rows, GRID format, cell size (X, Y) 0.000833333, 0.000833333.

Any help would be appreciated.

Thanks.

0 Kudos
3 Replies
DanPatterson_Retired
MVP Emeritus

You seem to be working with unprojected coordinates (ie decimal degrees) was this accounted for when deriving the slope? or was it determined using projected data?

If you extract by a mask, then nodata values are expected unless your mask was perfectly rectangular and aligned with the X/Y axes.  Do you have an image of your study area with the mask?

There seems to be some confusion on the use of resample... You are trying to go from a resolution of

(0.0008333 degrees, 0.000833 degrees) to (1 degree,1 degree))

That is a pretty big resampling and unless your study area is much bigger than 1 degree X 1 degree it isn't surprising that you don't see much of anything.

Can you clarify your procedures prior to code examinations, just to make sure you are working with the correct units etc.

0 Kudos
ChathurikaMediwaththe
New Contributor

Hey Dan,

 

Thanks for your reply. Sorry, I am a bit new to ArcMap.

 

Here are some screenshots of my study area.

 

The original DEM, input raster to Extract-by-Mask (after running Slope on the DEM) and mask (building shapefile) have the geographic coordinate system “GCS_GDA_1994”. So they have unprojected coordinates, right? The slope tool was run on the DEM with this geographic coordinate system, so not projected data.

 

The building shapefile represents a very small area on the DEM with a small number of buildings (see Study_Area2 screenshot).

 

To run “Extract-by-Mask”, do both the input raster and mask have to be in a projected coordinate system?

0 Kudos
DanPatterson_Retired
MVP Emeritus

First, extract the small portion of the dem from the larger one.  This can be done by a variety of means, like simply setting the Extent in Geoprocessing Properties then using Copy raster.  

Once you have the area extracted, Project (raster) it using an appropriate cell size and projection (maybe a UTM for your area)

After projection, then perform Slope calculations... you X, Y and Z values will now have the same values (ie meters).

Proceed from there