Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have two datasets: point feature class and raster (stored in file geodatabase). The spatial extent of the raster is smaller than the point dataset.

Is there a way I could select (or create new, temporary layer/feature class) only the points that fall into the extent of the raster?

Basically I'd like to have an output similar to Clip or Intersect tools, but they don't seem to accept rasters as inputs.

Is there readily available arcpy tool(s) that could be used to achieve that? Or would it require some custom solution?

share|improve this question
1  
Related: gis.stackexchange.com/questions/26893/… –  Chad Cooper Aug 28 '12 at 14:00
    
@ChadCooper Thanks. Your answer to this question might be indeed good solution. Will give it a go. –  radek Aug 28 '12 at 14:19
add comment

3 Answers

up vote 5 down vote accepted

The attached script which utilizes Raster Domain will work for you. Best of luck!

# Import arcpy module
import arcpy
from arcpy import env

# Check out any necessary licenses
arcpy.CheckOutExtension("3D")

# Set Workspace
env.workspace = r"C:\data"

# Create a polygon around the raster boundary
arcpy.RasterDomain_3d("inRaster.tif", "outShp", "POLYGON")

# Intersect points with boundary polygon
arcpy.Intersect_analysis(["outShp.shp", "points.shp"], "intersect_output", "ALL", "", "INPUT")

Edit:

For a direct, non ESRI approach, check out Geospatial Modelling Environment's (GME) isectpntrst (Intersect Points With Raster).

share|improve this answer
    
Looks good as well. Will give it a shot. –  radek Aug 28 '12 at 14:32
add comment

You could use the tool "Raster to Polygon" from the "Conversion Tools". As output you get a shapefile with the extent of your raster image. With this shapefile and the other one you could run the intersect command.

import arcpy
from arcpy import env
env.workspace = "C:/data"
arcpy.RasterToPolygon_conversion("zone", "c:/output/zones.shp", "NO_SIMPLIFY",
                                  "VALUE")
share|improve this answer
    
Thanks. Was thinking about this option as well and it indeed might be a viable solution. –  radek Aug 28 '12 at 13:29
add comment

Use these tools from ArcToolbox:

1-Spatial Analyst Tools> Raster Creation> Create Constant Raster ("Constant value" can
  be 0.5, 1, ... and "Output extent" must be your overlay raster )

2-Conversion Tools> From Raster> Raster to Polygon (Use output raster from step1)

3-Analysis Tools> Overlay> Intersect (the polygon with the points)

4-Done!

and here is the model:enter image description here

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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