1

background: raster extent (cols/rows) - foreground: files desired to have the same cols/rows numbers

The coloured file contains landuse information and it needs to have the same number of columns and rows as the DEM in the background for further processing. I can't get it to work - "clip" and "extract by mask" haven't generated the results I need.

It's supposed to keep its values within the coloured areas - but outside of that to the borders of the DEM (the whole black and white area) I need it to have NoData values.

  • 1
    I assume you are using ArcGIS? And do you have access to the Raster Calculator tool? (This will require spatial analyst extension) – Barbarossa Jul 7 '15 at 18:28
  • 1
    What is your ultimate objective? Why didn't clip or extract work for you? – Aaron Jul 7 '15 at 19:07
  • 1
    I think your landuse data is vector data. Is it a shapefile? You'll need to convert it to a raster first. – mkennedy Jul 7 '15 at 19:21
  • @aaron: clip and extract didn't seem to suit my purpose because the actual output when using theese tools will be taken from the input layer and, as far as i know, overwrite the data of the mask layer!? the ultimative objective is to gain one single ASCII (land use)grid which is required in another modelling tool. – cataloop Jul 7 '15 at 19:57
  • @barbarossa: yes,running ArcGis currently with access to the raster calculator. i assumed that i will have to use it eventually. what kind of calculation do you think there would be necessary? – cataloop Jul 7 '15 at 19:57
2

Use the raster calculator, set output extent and snap raster to the DEM in the tool environment, then use the land use raster layer as the expression. Easiest way to do that is to double click the land use raster layer in the layer list.

The output will be a raster with the extent of the DEM with NoData where there are no the land use values.

  • I just used your answer and approach myself. It may be helpful for future readers to include the raster calculator expression to convert NoData to 0 (or some other value) for use in calculations: Con(IsNull("inputraster"),0,"inputraster") – Aaron Mar 15 '18 at 2:13
  • @Aaron, the question specifically requires NoData values, not zeroes. But leave your comment there for future reference :) – user2856 Mar 15 '18 at 2:23
  • Sorry, I did not catch that about the NoData values. – Aaron Mar 15 '18 at 2:25
1

You can do this using the Raster Clip tool. You need to use the polygon dataset for the "Output Extent" parameter and then make sure that "Use Input Features for Clipping Geometry" is selected. This will fill the output dataset with the value you set for "NoData Value" for ever cell that is outside of the polygon boundaries.

  • 1
    i would have loved this to be the solution - tried just now but this also cuts down on my columns and rows (89/49 initially 132/84) – cataloop Jul 7 '15 at 20:08
  • 1
    and although i selected "Use Input Features for Clipping Geometry" the output again is of the DEM file...i did read in another article that messing with the "environments" (processing axtent and raster analysis) could help!? – cataloop Jul 7 '15 at 20:19

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.