0

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?

2
  • Is the projection a custom projection? I.e., not one you can choose from a list or dropdown?
    – Baltok
    Jun 12, 2013 at 14:47
  • It is a custom projection.
    – desOne
    Jun 12, 2013 at 15:21

1 Answer 1

2

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%")

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.