POST
|
I am using extras/clusterlayer to render clusters for a uniquevalue renderer.. all that works well and good except that the label colors are all white/black/whatever you set them to.. I though I'd just loop through the cluster layer object and change the label colors on a per graphic basis based on the color it got from the renderer.. This does not work. All label change color even if you specifically change one graphic. The loop is working and it seems to swap the colors properly but in the end the last color applied to the label has been propagated through all the graphics.. the little test loop below should alternate white and black labels for each cluster.. It doesn't, the best i can get it to do is change all the labels from black to white and back again. clusterLayer.setRenderer(UniRenderer); var graphics = clusterLayer.graphics; console.log(graphics.length); for(var i=0; i<graphics.length;i++) { if(i%2==0) { console.log("black"); //have also tried clusterLayer.graphics._graphicsLayer.clusterLabelColor clusterLayer.graphics[i]._layer._clusterLabelColor= "#000"; } else { console.log("white"); clusterLayer.graphics[i]._layer._clusterLabelColor= "#FFF"; } //console.log(label); //label = "#000"; } console.log(clusterLayer); var symbolList = clusterLayer.renderer._symbols;
... View more
03-10-2016
06:47 AM
|
0
|
0
|
1460
|
POST
|
Java SDK, the examples have this, but the api reference does not.. How to i get this?
... View more
01-14-2015
08:29 AM
|
0
|
1
|
4289
|
POST
|
Looking like a 'no' to me. I added an element name to a piece of annotation, but I still wasn't able to access it. I tried adding a normal text element into the map and wasn't able to access that either, so at least part of it might be that they're embedded in the dataframe space instead of the layout space. that's exactly what I tried doing. Very disappointing, now I need to sort out how to make text elements on the fly and populate them with the data from several fields. ArcObjects it is then.. pain in my ass, oh well.. Thank you for confirming my frustrations. Cheers!
... View more
08-09-2013
04:27 PM
|
0
|
0
|
498
|
POST
|
I have created standard annotations which are simply text on the map and i need to edit the text contained within. I though that these text annotations would be stored as text elements in the MXD, however it appears that they are not. Is there any way to edit these annotations with python?
... View more
08-09-2013
09:54 AM
|
0
|
7
|
1313
|
POST
|
Hello, Have an interesting problem. I have a table of data, (no geometry). I have Polygon features. What I would like to do is, based on polygon geometry, generate and place the table data as evenly distributed points within the polygon. Anyone have any ideas on where to start? I am in the midst of digging through coordinate geometry maths, but I really have no idea where i should start. Thank you.
... View more
03-15-2013
08:42 AM
|
0
|
0
|
1703
|
POST
|
in excel just drag the H column wider. The ###### symbols are excels way of telling you that the number is too big to fit into the cell width provided.
... View more
03-10-2013
06:37 PM
|
1
|
0
|
211
|
POST
|
I may be wrong here but i think you can avoid calculating them at all if you use the Linear Referencing Tool -> Create Routes it will take your line features and export a routed line with M Values populated. it can be a bit fiddly if you have Vertical line segments or extreme variations in Z. Also, See this post http://forums.arcgis.com/threads/73312-Reg-Create-Route-Tool
... View more
12-12-2012
06:03 AM
|
0
|
0
|
127
|
POST
|
Whenever I write/run python scripts I like to have some text confirmations of various steps along the way. The irritating thing is that the Python Window doesn't seem to scroll with the text that the script produces, forcing you to either click the scroll bar or just wait till its all done. Is there any sort of way to have the Python window scroll with any new text printed to screen? thanks
... View more
12-10-2012
05:14 AM
|
0
|
1
|
697
|
POST
|
Hello, Just curious if it is possible to find the pixel dimensions ie 1680x800(or whatever) of the data view window directly? my indirect plans to accomplish this are to build a function which will export a temporary image and gather its dimensions using PIL. The main function can then use the returned values for X and Y dimensions and move on accordingly. Thought i would ask about a more direct route before a start wandering down the path of uncertainty. thanks
... View more
11-07-2012
07:18 AM
|
0
|
0
|
618
|
POST
|
fortunately the changes were accepted, unfortunately they brought about the same error Runtime error <class 'arcgisscripting.ExecuteError'>: ERROR 000572: The output cannot be the same as input. Failed to execute (Append). I am now printing out what should be appending to what and where.. everything seems ok.. this problem is really confounding. OUTPUT:: Destination MDB - C:\Users\atimpson\Desktop\MDB Combiner\Combined.mdb Source MDB - C:\Users\atimpson\Desktop\MDB Combiner\20121008_Group_B_formatted.mdb Source FC - main Destination FC - main Destination location - C:\Users\atimpson\Desktop\MDB Combiner\Combined.mdb\main Runtime error <class 'arcgisscripting.ExecuteError'>: ERROR 000572: The output cannot be the same as input. Failed to execute (Append).
import os
import arcpy
import time
from arcpy import env
mdbList=[]
sizeList = []
mxd = arcpy.mapping.MapDocument("CURRENT")
mxdPath = mxd.filePath
workSpace = mxdPath.replace("\SetupRUN.mxd", "")
print workSpace
env.workspace = workSpace
dirlist=os.listdir(workSpace)
for item in dirlist:
if item.lower().endswith("mdb"):
print item
mdbList.append(item)
arcpy.CreatePersonalGDB_management(workSpace, "Combined.mdb")
destSpace = mxdPath.replace("SetupRUN.mxd", "Combined.mdb")
env.workspace = destSpace
destList = arcpy.ListFeatureClasses()
print "Destination Contents = " + str(destList)
for mdb in mdbList:
env.workspace = destSpace
destList = arcpy.ListFeatureClasses()
print "Dest Length = " + str(len(destList))
tempSpace = mxdPath.replace("SetupRUN.mxd", mdb)
print "Database = " + tempSpace
env.workspace = tempSpace
fcList = arcpy.ListFeatureClasses()
print "Destination MDB - " +str(destSpace)
print "Source MDB - " + str(tempSpace)
if len(destList) == 0:
for fc in fcList:
arcpy.Copy_management(fc, destSpace + "\\"+fc)
print "copied FC - " +str(fc)
elif len(destList) >=1:
for fc in fcList:
desc = arcpy.Describe(fc)
fcOut = os.path.join(destSpace, desc.name)
for dest in destList:
if fc == dest:
# print "Source FC - "+fc
# print "Destination FC - "+ dest
# print "Destination location - "+ destSpace + "\\" + fc
arcpy.Append_management([fc], fcOut, "NO_TEST" , "" , "")
print mdb
size = len(fcList)
sizeList.append(size)
print "FeatureClasses = " +str(fcList)
print "FC count = " + str(size)
print ""
print sizeList
print "Number of Databases to be Merged = " +str(len(sizeList))
#for mdb in mdbList:
#for mdb in mdbList:
#print mdbList[0]
#tempSpace = mxdPath.replace("SetupRUN.mxd", mdbList[0])
#print tempSpace
#arcpy.CreatePersonalGDB_management(workSpace, "Combined.mdb")
#workSpace_2 = mxdPath.replace("SetupRUN.mxd", "Combined.mdb")
#arcpy.Append_management ([mdbList], workSpace_2,"NO_TEST","" ,"")
#arcpy.CreatePersonalGDB_management(workspace, "Combined.mdb")
... View more
10-31-2012
12:57 PM
|
0
|
0
|
355
|
POST
|
EDIT: I figured it out.. apparently if there is data in the TOC it gets confused. By deleting the data from the TOC on each run through the loop i was able to get the append operation to work... odd problem with a simple solution. Thanks for taking a look, here is the updated main for loop for mdb in mdbList: env.workspace = destSpace destList = arcpy.ListFeatureClasses() print "Dest Length = " + str(len(destList)) tempSpace = mxdPath.replace("SetupRUN.mxd", mdb) env.workspace = tempSpace fcList = arcpy.ListFeatureClasses() print "Destination MDB - " +str(destSpace) print "Source MDB - " + str(tempSpace) if len(destList) == 0: for fc in fcList: arcpy.Copy_management(fc, destSpace + "\\"+fc) print "copied FC - " +str(fc) elif len(destList) >=1: for fc in fcList: for dest in destList: if fc == dest: print "Source FC - "+ fc print "Destination FC - "+ dest print "Destination location - "+ destSpace + "\\" + fc arcpy.Append_management([fc], destSpace + "\\" + fc, "NO_TEST" , "" , "") for df in arcpy.mapping.ListDataFrames(mxd): for lyr in arcpy.mapping.ListLayers(mxd,"",df): arcpy.mapping.RemoveLayer(df, lyr) Hi. I am working on a bit of python to merge many MDB worth of FC into a new freshly created MDB. For the most part they are the same. the error is ERROR 000572: The output cannot be the same as input. Failed to execute (Append) I have been trying to reconcile this error for the better part of a few days with no luck. I am almost positive that the source and destination are different things. OUTPUT WINDOW:: Destination MDB - C:\Users\atimpson\Desktop\MDB Combiner\Combined.mdb Source MDB - C:\Users\atimpson\Desktop\MDB Combiner\20121008_Group_B_formatted.mdb Runtime error <class 'arcgisscripting.ExecuteError'>: ERROR 000572: The output cannot be the same as input. Failed to execute (Append). import os import arcpy import time from arcpy import env mdbList=[] sizeList = [] mxd = arcpy.mapping.MapDocument("CURRENT") mxdPath = mxd.filePath workSpace = mxdPath.replace("\SetupRUN.mxd", "") print workSpace env.workspace = workSpace dirlist=os.listdir(workSpace) for item in dirlist: if item.lower().endswith("mdb"): print item mdbList.append(item) arcpy.CreatePersonalGDB_management(workSpace, "Combined.mdb") destSpace = mxdPath.replace("SetupRUN.mxd", "Combined.mdb") env.workspace = destSpace destList = arcpy.ListFeatureClasses() print "Destination Contents = " + str(destList) for mdb in mdbList: env.workspace = destSpace destList = arcpy.ListFeatureClasses() print "Dest Length = " + str(len(destList)) tempSpace = mxdPath.replace("SetupRUN.mxd", mdb) print "Database = " + tempSpace env.workspace = tempSpace fcList = arcpy.ListFeatureClasses() if len(destList) == 0: for fc in fcList: arcpy.Copy_management(fc, destSpace + "\\"+fc) print "copied FC - " +str(fc) elif len(destList) >=1: for fc in fcList: for dest in destList: if fc == dest: arcpy.Append_management([fc], destSpace + "\\" + fc, "NO_TEST" , "" , "") print mdb size = len(fcList) sizeList.append(size) print "FeatureClasses = " +str(fcList) print "FC count = " + str(size) print "" print sizeList print "Number of Databases to be Merged = " +str(len(sizeList))
... View more
10-31-2012
11:59 AM
|
0
|
2
|
1192
|
POST
|
Hi, we have a script that updates definition queries in MXDs and the data is mirrored in an arcglobe 3dd file as well. The script can not be run in arcglobe using arcpy.mapping.mapdocument("current") is there a workaround to allow the script to run?
... View more
10-22-2012
06:48 AM
|
0
|
0
|
1998
|
POST
|
Hello, I have a table of data i would like to place into an existing template CSV. The attached csv is the template i'd like to populate. The cells are numbered in the order that the data is generated in the source table. is there a way to write each cell as they are created by the statistics operation? I am not constrained to a CSV, i could do excel too.. really anything that would allow me to match the generated statistic to the appropriate position in the table.
... View more
10-18-2012
07:43 AM
|
0
|
0
|
482
|
POST
|
I use the following to create a Systems PDF folder every time i run this map export script.
import arcpy, os, datetime, sys
arcpy.env.overwriteOutput = True
#Setup variables
mxd = arcpy.mapping.MapDocument("CURRENT")
mxdPath = mxd.filePath
dataPath = mxdPath.replace(os.path.basename(mxdPath), "System PDFs\\")
try:
os.makedirs(dataPath)
except OSError:
if os.path.exists(dataPath):
# We are nearly safe
pass
else:
# There was an error on creation, so make sure we know about it
raise
... View more
10-17-2012
02:22 PM
|
0
|
0
|
527
|
Title | Kudos | Posted |
---|---|---|
1 | 11-14-2011 11:49 AM | |
1 | 03-10-2013 06:37 PM |
Online Status |
Offline
|
Date Last Visited |
02-18-2021
09:26 AM
|