I am trying to use the "Polygon to Raster" tool on a building extents polygon file to create a raster with the exact extents and cell size as an existing flood depth raster. Even though I have added my desired raster extent in the snap raster option in the Environment settings and defined the cell size, the result does not have the same extents. Furthermore, I made sure that they have the same projection (WGS_1984_UTM). I really need them to have the same extents and cell size as I want to do some calculations between them (e.g. calculate the flood depth at the buildings location). Any idea why this is happening?

  • Have you set the coordinate systems up correctly / identical? – Keagan Allan Jul 7 '18 at 8:57
  • 3
    You should try and only ask one question per post and your extra question will also be almost impossible to answer. – BERA Jul 7 '18 at 8:59
  • Allan, yes they both have the same projection. BERA, I am sorry for the 2nd question. It is my first post and I was not that familiar with the rules. I have edited my post and removed the extra question. – Panos Jul 8 '18 at 17:21
  • Are you trying to copy a raster or convert a polygon-based feature class into a raster? Can you edit your question and include the extents, coordinate systems, other metadata plus screenshots of part of the layers so we can see what's happening? – mkennedy Jul 8 '18 at 20:42
  • arcpy.env.extent = r'c:\your\existing\raster' (resources.arcgis.com/en/help/main/10.2/index.html#//…), setting snapraster (resources.arcgis.com/en/help/main/10.2/index.html#/Snap_Raster/…) and cellsize just ensures the cell boundaries align by using an existing origin. What calculations need them to be precisely the same size? – Michael Stimson Jul 8 '18 at 23:25

I realized that to have the rasterized polygons with the same extents and cell size, you have to both choose the desired raster as the extents AND as the snap raster. This resulted in a raster with the exact same extents and cell size as the desired one.

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.