POST
|
Hi @asmith_tssw., Depending on the method, either python or arcade, you can easily achieve this. You can do something like this: Python: Code Expression:
!Concatenation( FieldA , FieldB , FieldC, etc... )!
Code Block:
def Concatenation( FieldA , FieldB , FieldC, etc... ):
Values = [FieldA , FieldB , FieldC, etc...]
ConcatNonNullValues = ''.join([ x for x in Values if x is not None ])
return ConcatNonNullValues Arcade: var ValueList = [ $feature.FieldA , $feature.FieldB, $feature.FieldC, etc... ]
var ConcatValue = ''
for ( var index in ValueList ){
ListValue = ValueList[ index ]
if ( IsEmpty( ListValue ) == False ){ ConcatValue + ListValue }
}
return ConcatValue You can use several arcade functions to make the code above easier, but it depends on how you want to go about it. Feel free to play around with the code above. It should work for what you need or at least point you in the right direction.
... View more
yesterday
|
1
|
0
|
90
|
POST
|
Hi @SaraChowdhury, Have you tried using the dissolve tool to see if that would get you the information that you need? If not, then you can give that a try and then use a group filter to filter databased on matching attributes in a field. Another option is to use arcade to get a total for each unique attribute and update each record with the total for each matching attribute. var State = $feature.State
var StateTotal = sum( filter( $featureset , 'State = @State' ) , 'Number of Household Members' )
Console( StateTotal )
return StateTotal The above code should work for what you need. You can use it to field calculate the total for each state and get the household totals.
... View more
Tuesday
|
1
|
0
|
43
|
POST
|
Hi @LeighErik, You can simply create a join table, which would look something like: Select AB.Fielda , CD.Fieldb, etc..
From ( TableName ) Alias (ex: AB)
Join ( TableName ) Alias (ex: CD)
On AB.IDField = CD.IDField *In this case it would be the zip code field*
*Where clause* Without knowing the full code this should help with what you are looking for. This will also allow for you to construct a single table by basically combining multiple tables using matching rows in a single field. The other thing is I am unsure of the number of tables you wish to do this with, but you can repeatedly join tables based on matching records in a specified field.
... View more
a week ago
|
0
|
1
|
125
|
POST
|
Hi @VPCPlanningZoning, Based on the information, if I have this correctly, is you are trying to identify the width of the forest using the stream to determine the average width of the forest. If that is the case, then you can easily split the polygon into several smaller polygons by dividing the polygon into several smaller parts, convert the layer to a polyline feature using the feature to line tool, split each polyline feature by the vertices, and then get all line features that are identical, and get the average lengths of the intersecting segments to give you a more accurate estimate of the average width with greater accuracy.
... View more
2 weeks ago
|
0
|
0
|
126
|
POST
|
The Includes function or a for loop I believe could also work as well. Plenty of options for achieving similar results.
... View more
2 weeks ago
|
1
|
0
|
159
|
POST
|
Another option that works as well is using contingent values. This will automatically limit values based on inputs of other values.
... View more
2 weeks ago
|
2
|
0
|
189
|
POST
|
Yes there is. One way you can do this is to have the layer duplicated in the same map but leave one layer checked in the legend and the other in the display.
... View more
3 weeks ago
|
4
|
0
|
117
|
POST
|
You can save your arrow design as a symbol layer and have it applied to the entire layer. When you edit the layer it will draw using that symbol layer.
... View more
3 weeks ago
|
0
|
0
|
89
|
POST
|
In memory simply creates a temporary feature. The feature itself is unrelated to the actual feature that the data is created from hence in memory. The processing would be roughly the same, though it largely depends on the type of cpu that you are using. If speed is something you are looking for then you could check out threading and multiprocessing.
... View more
3 weeks ago
|
0
|
1
|
164
|
POST
|
Try this: var ID = $feature.NewID //Change to whichever id field
var CurrentLength = $feature.Shape_Length// Change to length field
var IDField = 'NewID'
if ( IsEmpty( ID ) ){ ID = 1000 }// Specify starting id value
var SQLFilter = IDField + ' = '
var CompareMatchLen = Max( Filter( $featureset , SQLFilter ) , 'Shape_Length' )
if ( CurrentLength <= CompareMatchLen ){ ID = max( $featureset , IDField ) + 1 }
console( ID )
return ID This works in version 10.9.1. for Enterprise and 2.8 for Pro.
... View more
4 weeks ago
|
0
|
0
|
103
|
POST
|
The code above looks simple enough that it is efficient as is. If you are looking to simplify your code further you can use this example below: Expression: hierarchy_creator_feet(!highway!) Code Block: def hierarchy_creator_feet(p_highway):
hierarchy = 0
if p_highway in ('footway', 'pedestrian', 'residential', 'living_street', 'crossing', 'track', 'path'): hierarchy = 3
elif p_highway in ('tertiary', 'tertiary_link', 'unclassified', 'steps', 'service'): hierarchy = 23
elif p_highway in ('secondary', 'secondary_link', 'primary', 'road'): hierarchy = 23
elif '[' in p_highway: hierarchy = 33
return hierarchy or def hierarchy_creator_feet(p_highway):
hierarchies = {
3 : ('footway', 'pedestrian', 'residential', 'living_street', 'crossing', 'track', 'path'),
23 : ('tertiary', 'tertiary_link', 'unclassified', 'steps', 'service'),
33 : ('secondary', 'secondary_link', 'primary', 'road')
32 : '['
}
hierarchy = 0
for a , b in hierarchies.items():
if p_highway in b or b in p_highway: hierarchy = a
return hierarchy If you are able to reduce your code to the simplest level for both the result and ease of troubleshooting then it is already efficient enough. There are ways to write simpler code, but it mostly boils down to preference at that point.
... View more
4 weeks ago
|
0
|
1
|
199
|
POST
|
It is still a relatively new language that even I don't know why some things work and others don't. I also code in python and only started using arcade about a year ago, and I still don't understand why some things that work in other programming languages doesn't work in arcade. I also didn't realize that I made a mistake in one of the examples that I provided. You could have the field name variable used within the FeatureSetByName. That I know does work. I will need to update it to show that.
... View more
a month ago
|
1
|
2
|
138
|
POST
|
The issues with this, that I have discovered, is there is a bug that ESRI is aware of where assigning the feature name to a variable will cause some issues. The FeatureSetByName is used to call an entire feature. With this you have to specify the exact name of the featureclass or table, otherwise it will result in an error when you try to run the code. The other thing is you have to include all fields that you want to check. I noticed that the "OBJECTID" field was missing which would also result in an error. It will check when running the code validation for errors but result in an error when ran. The Expects can be used on $featureset or $feature, but if used on $feature will only return values within that row/record. You will want to specify a $featureset in order to return all values within the specified table/featureclass. Give the code below a try and see if it works for you. // INPUTS
var fcName = "TEST"
var fldName = "Name_Text"
var OIDField = 'OBJECTID'
var Testing = $feature.Name_Text
// These two lines must be written with the actual strings, not the variables above.
Expects($featureset, OIDField , fldName )
for (var i in $featureset) {
if ((i[fldName] == Testing ) && (i[OIDField ] != $feature[OIDField ])) {
return {"errorMessage": "ERROR: value not unique within field!"}
}
}
// If error above not found, return results dict with value as-is.
var fldUpdates = { fldName : Testing }
Console({"result": {"attributes": fldUpdates}})
return {"result": {"attributes": fldUpdates}} If that code does not work you can try this one. // INPUTS
var fcName = "TEST"
var Testing = $feature.Name_Text
var OID = $feature.OBJECTID
var OIDField = "OBJECTID"
var NameField = "Name_Text"
// These two lines must be written with the actual strings, not the variables above.
var features = FeatureSetByName($datastore, "TEST", [OIDField , NameField ])
for (var i in features) {
if ((i[NameField] == Testing ) && (i[OIDField] != OID )) {
return {"errorMessage": "ERROR: value not unique within field!"}
}
}
// If error above not found, return results dict with value as-is.
var fldUpdates = { NameField : Testing }
var Result = {"result": {"attributes": fldUpdates}}
Console(Result )
return Result
... View more
a month ago
|
1
|
4
|
171
|
Title | Kudos | Posted |
---|---|---|
1 | yesterday | |
1 | Tuesday | |
1 | 2 weeks ago | |
2 | 2 weeks ago | |
4 | 3 weeks ago |