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.

So in model builder I would like to have one input feature class projected to match the projection of another layer (a raster layer) that is a variable in the model. Can anyone help me achieve this?

share|improve this question
    
Is the projection a custom projection? I.e., not one you can choose from a list or dropdown? –  Baltok Jun 12 '13 at 14:47
    
It is a custom projection. –  desOne Jun 12 '13 at 15:21
add comment

1 Answer 1

up vote 1 down vote accepted

Use the Calculate Value tool with a bit of arcpy to retrieve the coordinate system of your raster then pass it to the Project tool as an output coordinate system.

  1. In model builder, connect your raster dataset as precondition to the Calculate Value tool

  2. Within the Calculate Value tool's code block, add this

    def rasterPrj(raster):
      return arcpy.Describe(raster).spatialReference
    
  3. Set the Data Type as Spatial Reference

  4. Type this in the expression rasterPrj("%inRas%")

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.