POST
|
In 10.5 I had to remove the imagery from the mxd and then the mpk processed.
... View more
05-13-2019
08:07 PM
|
0
|
0
|
12417
|
POST
|
Thank you for this. It works perfectly and is exactly what I needed!
... View more
10-17-2012
08:20 PM
|
0
|
0
|
417
|
POST
|
This is related to Retain ESRI symbology in Mapinfo TAB As a workaround I am wondering if I can save all my ESRI symbology from the lyr files created using the script below to an ESRI style sheet and then convert that to a font set which can be opened in mapinfo/opengeo? [ATTACH=CONFIG]15752[/ATTACH] The image above shows some of the [complex] symbology that we have in our ESRI mxd's that need to go into Mapinfo and/or Opengeo to be available via WMS. Tests show that KML created from the lyr files handle the symbology better than tab but not every time. Code so far... # Author:
import arcpy, string, datetime, shutil, os
import arcpy.mapping as MAP
#Read input parameters from script tool
MXDList = string.split(arcpy.GetParameterAsText(0), ";")
ProjectPath = arcpy.GetParameterAsText(1)
#MXDList=r'P:\2012\183_TownPlanning_Symbology\Working\test.mxd'
#ProjectPath=r'P:\2012\183_TownPlanning_Symbology\Working'
count=0
#Loop through each MXD and print
#for MXDPath in MXDList:
#MXDFile=r'P:\2012\183_TownPlanning_Symbology\Working\Strategic_Plan_Ravenshoe_8.mxd'
count=count+1
print count
##try:
mxd=arcpy.mapping.MapDocument(MXDFile)
outPath = ProjectPath+'\\'+mxd.filePath[mxd.filePath.rfind('\\')+1:mxd.filePath.rfind('.')]
os.mkdir(outPath)
msd = outPath+'.msd'
dfList = arcpy.mapping.ListDataFrames(mxd)
for df in dfList:
#arcpy.mapping.ConvertToMSD(mxd, msd, df, "NORMAL", "NORMAL")
#arcpy.AddMessage(str(count)+'...' +str(outPath)+'...'+'\n')
lyrList=arcpy.mapping.ListLayers(mxd, "", df)
outPath = ProjectPath+'\\'+mxd.filePath[mxd.filePath.rfind('\\')+1:mxd.filePath.rfind('.')]+'\\'+str(df.name)
os.mkdir(outPath)
for lyrFile in lyrList:
if lyrFile.isFeatureLayer == True:
if lyrFile.visible == True:
arcpy.AddMessage(str(lyrFile)+' is visible')
print str(lyrFile)+' is visible...exporting dataset'
outFileN=str(arcpy.ValidateTableName(lyrFile.longName[lyrFile.longName.rfind('\\')+1:]))
try:
arcpy.FeatureClassToFeatureClass_conversion(lyrFile.dataSource, outPath, outFileN)
arcpy.SaveToLayerFile_management(lyrFile,outPath+'\\'+outFileN+'.lyr', "ABSOLUTE")
arcpy.LayerToKML_conversion(outPath+'\\'+outFileN+'.lyr', outPath+'\\'+outFileN+'.kmz')
except:
print 'Exists...continuing'
arcpy.AddMessage(str(lyrFile)+' is visible')
print str(lyrFile)+' is not visible'
##except:
## errorM=arcpy.GetMessages()
## arcpy.AddMessage(str(count)+str(errorM)+'\n continuing...\n')
## print errorM
## #MAP.PrintMap(MXD, printer)
#Remove variable reference to file
del mxd, msd BTW// I tried the msd route (change to .zip and open the xml) but it is very convoluted.
... View more
07-03-2012
11:02 PM
|
0
|
0
|
1483
|
POST
|
No problem Graeme - BTW I also posted it at http://gis.stackexchange.com/questions/23375/acrpy-ddp-alter-graticule-logically-in-varying-map-scales as I was hoping that there would be an answer to this after SP4 BTW I found that the centering issue can be resolved by grouping all the items once they are centered properly at one scale. best
... View more
04-15-2012
12:27 AM
|
0
|
0
|
825
|