2

I'm new to the GIS world, and using ArcGIS 10, so please forgive me if this is a simple question. I have DTED files (level 2) that I have placed into a mosaic dataset, and I'm trying to determine which DTEDs intersect a polygon in another layer. I'm using python, and used the SelectLayerByLocation method, but am having trouble getting the results from it.

I can't use the CopyFeatures method (which is what's in all the examples) because it's probably returning a mosaic layer instead of feature. I also tried the Copy method, but that didn't work either.

Any suggestions?

Here's that part of my code:

   arcpy.MakeMosaicLayer_management('CreateMosaicDataset', 'mosaic_lyr')
   arcpy.SelectLayerByLocation_management("mosaic_lyr", "INTERSECT", buffershape)
   # If features matched criterias write them to a new feature class
   arcpy.Copy_management("mosaic_lyr", "DTEDs_for_Shape")

My solution was:

  # Create a Mosaic Layer from the mosaic dataset
    arcpy.MakeMosaicLayer_management('CreateMosaicDataset', 'mosaic_lyr')
    # Select DTEDs intersecting the polygon
    arcpy.SelectLayerByLocation_management("mosaic_lyr/Footprint", "INTERSECT", buffershape)
    # write selected features to a new feature class
    arcpy.CopyFeatures_management("mosaic_lyr/Footprint", "DTEDs_for_Shape")
1
  • 1
    please be more specific about the question.
    – Brad Nesom
    Commented Dec 15, 2011 at 22:34

1 Answer 1

2

If you want to select the dted that is intersected by a polygon.
You probably need to utilze the footprint in the mosaic dataset.

2
  • When I used ArcMap, I used the footprint to find the intersecting dteds. But, how do I specify the footprint in the python script? The SelectLayerByLocation method currently runs without errors, but I don't know what to use to 'get' the results. Do you know what I need to use to get those results? When I try CopyFeatures, it says "the value is not a Feature (or Raster Catalog) Layer". When I try Copy, it says "value is not a Data Element". I'm stumped :-)
    – Ruth
    Commented Dec 16, 2011 at 15:35
  • 1
    Brad - Thanks so much for suggestion - it led me to my solution. I should've realized it myself, since I used the footprint when I did the selection manually in ArcMap! Here's my solution: # Create a Mosaic Layer from the mosaic dataset arcpy.MakeMosaicLayer_management('MosaicDataset','mosaic_lyr') # Select DTEDs intersecting the polygon arcpy.SelectLayerByLocation_management("mosaic_lyr/Footprint", "INTERSECT", buffershape) # write selected features to a new feature class arcpy.CopyFeatures_management("mosaic_lyr/Footprint", "DTEDs_for_Shape")
    – Ruth
    Commented Dec 16, 2011 at 17:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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