I want to batch insert WMS layer to my arcmap MXD project with python/arcpy script.
Some issues has been unanserwed, here my “state of art”:
All of these solution propose to use
- ArcMap to Add WMS layer manually
- do “Save as Layer File”
-
reuse the .lyr to add to a new TOC by arcpy with this code
mxd = arcpy.mapping.MapDocument("CURRENT") df = arcpy.mapping.ListDataFrames(mxd)[0] imagery_lyr = arcpy.mapping.Layer(r"pathto.lyr") arcpy.mapping.AddLayer(df, imagery_lyr)
The lastest idea work properly with “static” WMS services.
When you have a “dynamic” changing WMS services, you need to maintain manually all the pre-generated lyr.
Does somebody know how to load WMS layer into ArcMap MXD with arcpy?
Does somebody know how to create .lyr file from WMS with arcpy?