Quantcast
Channel: Question and Answer » arcpy
Viewing all articles
Browse latest Browse all 767

ArcGIS 10 arcpy to add a WMS Service to MXD

$
0
0

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

  1. ArcMap to Add WMS layer manually
  2. do “Save as Layer File”
  3. 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?


Viewing all articles
Browse latest Browse all 767

Latest Images

Trending Articles



Latest Images