I want to export a calculated raster to a point shapefile with predefined geometry (i.e. positioning and extent of the points). Points not covered by the raster should return empty values (e.g. NoData). It works for the positioning of the points, however it does not work for the extension of the points.

I do have:

  • point shapefile MyTemplatePoints.shp as a template
  • raster file mytempr calculated from template point shapefile above
  • raster file mycalcr calculated from various input data in an arcpy-script
  • point shapefile MyCalculatedPoints.shp exported from mycalcr with Raster to Point (Conversion)

The arcpy-script to calculate mycalcr contains the following command line:

arcpy.env.snapRaster = mytempr

By this, the centroids of the cells of mycalcr snap to those of mytempr. The two rasters have different extensions which is not a problem. Export of mycalcr to MyCalculatedPoints.shp is performed with Raster to Point (Conversion) with input parameters as shown to the left in the image. The points of MyCalculatedPoints.shp fit to the positioning of the points of MyTemplatePoints.shp as visible to the right in the image. However, the extension of MyCalculatedPoints.shp does not match the extension of MyTemplatePoints.shp as I would expect by Environment Settings > Processing Extent.

It seems to me that this processing is unsuitable to generate a point shapefile with larger extension than the raster itself (and to fill these points with empty values, e.g. NoData).

What am I missing?

enter image description here

  • Do you have Spatial Analyst extension? If yes have you tried Extract by Points? – BERA Apr 17 '20 at 16:02

The hint by BERA made me find the solution: use Spatial Analyst Tools > Extraction > Extract Values to Points and define the desired Extent and Snap Raster in the Environment Settings:

enter image description here

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.