Monday, 10 December 2018

arcgis 10.0 - Adding Raster Layer without lyr file using ArcPy?


i wonder how i can add a raster layer to a remote (not the current) mxd file with arcpy. I need to not use a lyr file for that.


For vector Layer i have the following lines working fine :


mxdPath = "D:\FormationSpecialisee\IGN_IFI\doc1.mxd"
mxd = arcpy.mapping.MapDocument(mxdPath)
layer = arcpy.mapping.Layer(fcADD)

arcpy.mapping.AddLayer(df, layer , "AUTO_ARRANGE")

but it seems to not work for Raster Layer.




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...