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?
-
Is the projection a custom projection? I.e., not one you can choose from a list or dropdown?– BaltokJun 12, 2013 at 14:47
-
It is a custom projection.– desOneJun 12, 2013 at 15:21
1 Answer
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.
In model builder, connect your raster dataset as precondition to the Calculate Value tool
Within the Calculate Value tool's code block, add this
def rasterPrj(raster): return arcpy.Describe(raster).spatialReference
Set the Data Type as Spatial Reference
Type this in the expression rasterPrj("%inRas%")