POST
|
Alright, I've got something going. I've symbolized all of one category a certain color, and based on a different field had their size changed. It's a mess right now, but hopefully it will help you out. Here goes: In Symbology -> Multiple Attributes -> Quantity by category Value Fields: choose whatever you want the color to change based on the field. Symbol Size... choose the other field (for size). Hit ok and see how it looks, then adjust accordingly. Sorry I know it's not perfect, but I just learned it and figured I'd let you know haha. Edit: I guess it's implied, but "Add All Values" then hit ok. Unfortunately my field is a string and the symbol size (or color ramp) option only takes int/float values it looks like. Maybe I just need to quit being lazy and manually define them all 😛
... View more
09-24-2013
01:51 PM
|
0
|
0
|
855
|
POST
|
Ahhh right. What about combining the two fields and then going unique values, one field? Edit: then all the 1A and 2B and 3C, etc... values will be grouped? Hmm not sure what you mean by the "values will be grouped" I considered doing what you are suggesting but wouldn't that just result in the same thing, just instead of using multiple fields I will be using one field, but I will still end up with just as many variations that I will have to manually symbolize one by one?
... View more
09-24-2013
01:29 PM
|
0
|
0
|
855
|
POST
|
Hmmmm...not sure if this will take a while for you, but you can go to Symbology -> Categories -> Unique Values, many fields. That might help or at least get you started? That would be the long way, yeah. I am hoping there is an easier way. The problem with Unique Values, Many Fields is, it gives you all the variations, but doesn't give you a quick way to symbolize "similar" things, such as all (Field1=1) values being the same type of symbol regardless of the value of field2.
... View more
09-24-2013
01:25 PM
|
0
|
0
|
855
|
POST
|
I am trying to figure out how to easily define my symbol classes for a layer. I want to symbolize using two fields but in a specific way. The first field will define the symbol being used, while the second field will simply change the color of the symbol. I am hoping there is an easy way to do this rather than defining every variation one by one. Example: Field 1 has values (1, 2, 3), Field 2 has values (A, B, C) 1A should be symbol 1 color 1 3C should be symbol 3 color 3 Thanks for the help.
... View more
09-24-2013
12:39 PM
|
0
|
8
|
1538
|
POST
|
Yeah I figured it was not good coding to put that if statement in there but it is what I could do with my limited knowledge 😞 I think the del is working well and it now loads all the labels fine. There is something wrong with your SQL statement though, that code returns an error and I only got it to work by removing the new data filter you added in. An error about not being able to convert all arguments during string converting. Thanks again for all your efforts.
... View more
09-11-2013
04:51 PM
|
0
|
0
|
3210
|
POST
|
Ah, interesting, zooming in did take prevent the crash. Didn't think that would matter since the labels would have to be created anyway. I am still a little hesitant that it might crash the system anytime but it does work. For the sql statement, I just wanted a data filter, which I worked around by putting it in the code with an if statement instead of using a sql clause
for row in rows:
if row[1] == "CHROMIUM": # data filter
finalString = (str(row[1]) + ": " + str(row[2]) + ": " + str(row[3])) # combining the label fields
labelList.append(finalString)
... View more
09-11-2013
04:29 PM
|
0
|
0
|
3210
|
POST
|
Finally got it to work to look more like what I want, although running into a resource problem which is causing ArcMap to crash. This code works, and does what I need it to do to display two fields instead of just the one
import arcpy
# variables that need to be customized for your specific data
def FindLabel ( [SampleName] ): # input the field name of the parent table's relate field
inputValue = [SampleName] # repeat the parent table's relate field
# define the data source path and fields of the related table
featureClass = r'Chromium_Data'
relatedFieldName = "sampleid" # the relate field name in the related table that corresponds to the input field
valueFieldName = "depth" # desired label value field name in the related table
valueFieldName2 = "result" # second field to label
# As long as you want a simple single field stacked label you should not need to change this code
whereArgs = [arcpy.AddFieldDelimiters(featureClass, relatedFieldName), "'" + inputValue + "'"]
whereClause = "%s = %s" % tuple(whereArgs)
labelList = []
rows = arcpy.da.SearchCursor(featureClass, (relatedFieldName, valueFieldName, valueFieldName2), whereClause)
for row in rows:
finalString = (str(row[1]) + ": " + str(row[2])) # combining the label fields
labelList.append(finalString)
labelList.sort() # uses correct sort order for numbers, dates or strings
labelList.insert(0, inputValue) # insert input value as a heading
return "\n".join(str(labelvalue) for labelvalue in labelList)
This code theoretically works using 3 label fields, the code verification process displays the correct result, but the processing is too much and causes ArcMap to crash.
import arcpy
# variables that need to be customized for your specific data
def FindLabel ( [SampleName] ): # input the field name of the parent table's relate field
inputValue = [SampleName] # repeat the parent table's relate field
# define the data source path and fields of the related table
featureClass = r'Chromium_Data'
relatedFieldName = "sampleid" # the relate field name in the related table that corresponds to the input field
valueFieldName = "param" # desired label value field name in the related table
valueFieldName2 = "depth" # second field to label
valueFieldName3 = "result" # third field to label
# As long as you want a simple single field stacked label you should not need to change this code
whereArgs = [arcpy.AddFieldDelimiters(featureClass, relatedFieldName), "'" + inputValue + "'"]
whereClause = "%s = %s" % tuple(whereArgs)
labelList = []
rows = arcpy.da.SearchCursor(featureClass, (relatedFieldName, valueFieldName, valueFieldName2, valueFieldName3), whereClause)
for row in rows:
finalString = (str(row[1]) + " - " + str(row[2]) + " - " + str(row[3])) # combining the label fields
labelList.append(finalString)
labelList.sort() # uses correct sort order for numbers, dates or strings
labelList.insert(0, inputValue) # insert input value as a heading
return "\n".join(str(labelvalue) for labelvalue in labelList)
It would be nice if ArcMap could handle this by itself, but I could work around it by pre-concatnating my 3 fields into one within the database. Of course editing the database is not an ideal solution, but at least we got a working solution. Side question, do you know if there is a way to run a SQL statement within the code to filter the results, such as only displaying results where "valueFieldName3 = "desiredValue""?
... View more
09-11-2013
02:54 PM
|
0
|
0
|
3210
|
POST
|
That code works brilliantly and is a perfect start. Now I just need to figure out how to make the label a little more complicated rather than just stack lines. Going on work on figuring this out myself, but I will probably need your help if you are still willing. Thanks a lot for what you have already done.
... View more
09-11-2013
01:04 PM
|
0
|
0
|
3210
|
POST
|
I know this is something we have been asking for forever, but I do not know if there is a real solution for this yet? Did anyone ever manage to recreate the "One to Many Label" script from VB6? Did ESRI finally give us a real solution to do the labeling? I saw one option of doing it using pivot tables that would require ArcInfo license, but that is a very roundabout solution using a license most people don't have. If anyone knows of a working solution please let me know. If you don't know what I am talking about, basically I am looking to make "callout box" type of labels such as: MW01 DEPTH BENZENE XYLENE 12 34 0.78 18 102 9
... View more
09-10-2013
12:51 PM
|
1
|
27
|
10729
|
POST
|
Sounds like I basically would need to treat culverts as streams and "burn" them. I am working through the documentation and hopefully can figure out the workflow. Thank you both, that is some very useful information.
... View more
02-21-2013
09:48 AM
|
0
|
0
|
393
|
POST
|
I have not used ArcHydro before and am wondering if it will be appropriate to analyze a flat area with culverts as the primary tool for the water movement. From all the research I have done so far, ArcHydro seems to be made mostly for natural water movement using streams and lakes, so I am not sure if this is the right path for me to go. Thanks for the help.
... View more
02-20-2013
01:51 PM
|
0
|
3
|
1831
|
POST
|
Changing the labeling engine to use Maplex will make the legend automatically wordwrap which should solve your problem. Right click Data Frame > Properties > General > Label Engine > Maplex Label Engine
... View more
02-05-2013
02:11 PM
|
0
|
0
|
1479
|
Title | Kudos | Posted |
---|---|---|
1 | 09-10-2013 12:51 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|