|
POST
|
According to the error message, your new point doesn't intersect any features in "B_DSD_District". So you should probably take a look at your Python script and correct that. Alternatively, you can change the Attribute rule, so that it doesn't return an error when that happens: var featureSet = FeatureSetByName($datastore,'B_DSD_District', ['DIV'], true);
var featureSet2 = Intersects(featureSet, Geometry($feature))
var result = First(featureSet2)
if(result==null)
return null // return no value instead of an error
else
return result.DIV This might break some of your workflows if it is important that this field is filled!
... View more
08-29-2022
03:28 AM
|
0
|
2
|
1551
|
|
POST
|
The Cut() function is for cutting geometries, not for detecting cuts. $editcontext.editType only returns "INSERT", "UPDATE" or "DELETE". There is no way to trigger the rule only on a merge or cut operation. A possible workaround could be to detect changes in the geometry: // Attribute rule to calculate parcel id
// triggers: insert, update
var geometry_changed = $editcontext.editType == "UPDATE" && !Equals(Geometry($feature), Geometry($originalfeature))
if($editcontext.editType == "INSERT" || geometry_changed) {
var new_id = ...
return new_id
}
// If we land here, the feature got updated, but the geometry didn't change
return $feature.ParcelID But this will calculate a new ID everytime you edit the geometry. So it will only work if cutting and merging are the only geometry edits you do.
... View more
08-29-2022
03:18 AM
|
0
|
3
|
1587
|
|
POST
|
You're mixing up a few things... txt[z]= features.[code_pat].[z] wrong order of code_pat and z. z is the index of the feature in the featureset, code_pat is the attribute of the feature. you can either use the dot notation or use the bracket notation to get to the attribute, not both. you have to use brackets to get the index if you use brackets, you have to input a string. this line should look like this: txt[z]= features[z]["code_pat"] txt[z]= features[z].code_pat var nb = []; nb = number (txt); Number() only converts a single value, not all elements of an array. you should call Number in the for loop txt looks like this: ["PAT0001", "PAT0002", ...] Number("PAT0001") returns NaN (not a number), because you didn't eliminate the text part before. Here are better ways to do what you want: If you are working in an Enterprise Geodatabase, create a new database sequence and use it to automatically increment your id field: var id = NextSequenceValue("NameOfTheDatabaseSequence")
return "PAT" + Text(id, "0000") If you work in a File Geodatabase, you don't need a for loop. You can just order the featureset by your id field (descending), grab the first feature (the one with the max id) and get the number from that: // get the feature with the highest id
var max_feature = First(OrderBy($featureset, "code_pat DESC"))
// get the number of that id
var max_number = 0
if(max_feature != null) { // no features in featureset? -> this block is skipped and max_number is 0
var txt = Replace(max_feature.code_pat, "PAT", "")
max_number = Number(txt)
}
// calculate and return the new id
return "PAT" + Text(max_number + 1, "0000")
... View more
08-29-2022
03:02 AM
|
0
|
1
|
2201
|
|
POST
|
You're comparing $feature.RAINFALL to a string value. Is the field really a string field? Also, you can shorten that script like so: var mdm1 = [1,1,2,2,3,3,3,5];
var mdm2 = [1,1,1,2,2,2,2,3];
var mdm;
if (DomainName($feature,"Area_Charectristics") == "Open Forest")
{ mdm=mdm1;}
if (DomainName($feature,"Area_Charectristics") == "Open Grassland")
{ mdm=mdm2;}
var index = Number($feature.RAINFALL);
return mdm[index]
... View more
08-29-2022
02:21 AM
|
0
|
0
|
1158
|
|
POST
|
Loading feature sets is slow. It gets much slower if you load all fields and the geometries. You can make it much faster by only loading the fields you need, and only loading the geometry if you need to work with it. It's not really intuitive, but you don't need to load the geometries for Intersects(). EDIT: Nope, this is wrong Just using these tricks, I got your script from 33 seconds to 0.6 seconds! EDIT: Yes, but it doesn't return the correct results anymore var boundaries = FeatureSetByPortalItem(
Portal('https://arcgis.com/'),
'a1795cc14f9744d68787f649a7865715',
1,
['MEMBER', 'Type', 'DISTRICT', 'District_Sort'],
false
);
var nno = FeatureSetByPortalItem(
Portal('https://arcgis.com/'),
'6d13be8f482e434ea129f751c00385b0',
0,
['Expected_Attendance'],
false
);
// rest is the same
... View more
08-29-2022
02:14 AM
|
0
|
5
|
2510
|
|
POST
|
If you have built a relationship class, you can get the related table entries like this: var related = FeatureSetByRelationshipName($feature, "NameOfTheRelationshipClass") If not, you have to load and filter the table like this: var table = FeatureSetByName($datastore, "NameOfTheTable")
var id = $feature.PrimaryKey
var related = Filter(table, "ForeignKey = @ID") And then it depends on what you want to extract from the related table entries. Some examples: // Return the count
return Count(related)
// return max/min/mean/sum of a field
return Max(related, "FieldName")
... View more
08-29-2022
01:47 AM
|
2
|
0
|
7972
|
|
POST
|
Ah. Hosted layers—ArcGIS Online Help | Documentation doesn't list MapImage layers as type of hostable layer. Seems like you can't use them in AGOL, only in Portal. I'm sorry, I can't really help you here. Only tip I have is to host only a small set of features. If these get displayed correctly, the problem is probably the amount/complexity of the data. If they also have display errors, it could be a problem with your geometries, which might be resolved with the Repair Geometry tool.
... View more
08-29-2022
01:21 AM
|
0
|
0
|
4302
|
|
POST
|
The Arcade expression returns a Dictionary, but it seems like JS can't convert that. Sadly, I have no idea about the JS API. You can probably get some help in the ArcGIS API for JavaScript - Esri Community
... View more
08-29-2022
01:09 AM
|
0
|
1
|
2287
|
|
POST
|
I'm not quite sure what your question is. I'm assuming you want to limit the fields that get printed. You can do that like so: var fips = $feature["parent_id"]
var dd = FeatureSetByName($map, "Survey v2", ['age', 'gender', 'race'], false)
var fillterSur = "survey_id = @fips"
var cou = First(Filter(dd, fillterSur))
if(cou == null) { return "no survey found" }
var attributes = Dictionary(Text(cou))["attributes"]
var print_fields = ["age", "gender", "race"] // define the fields you want to print in the popup
var popup_lines = []
for(var f in print_fields) {
var a = print_fields[f]
var line = `${a}: ${attributes[a]}`
Push(popup_lines, line)
}
return Concatenate(popup_lines, TextFormatting.NewLine)
... View more
08-29-2022
01:06 AM
|
0
|
0
|
1857
|
|
POST
|
Import your Excel sheet into ArcGIS Pro and run the Join Field tool. Use the polygons as input table and the Excel sheet as join table. Choose a field for both tables that uniquely identifies the features. Choose the fields you want to add to the input table.
... View more
08-29-2022
12:59 AM
|
0
|
0
|
31441
|
|
POST
|
Make sure that you actually have connected your map frame to a map: The map frame's extent is independent of the map's extent. So maybe your map frame just shows an empty part of your map. Activate the map frame to interact normally with the map, try to zoom to a layer:
... View more
08-25-2022
02:52 AM
|
1
|
0
|
23076
|
|
POST
|
The environment variables only apply to the output features, not the input. If you look at the Python script of the tool, it generates the points using the arcpy.Polyline.positionAlongLine() method. This method only uses 2D coordinates. There is no arcpy.Polyline method that does this in 3D. I found this old thread: Construct Points on polyline at 3d distance - Esri Community There you can find a positionAlongLine_3d method you can use. There's also a link to an ArcMap AddIn that considers Z values and talk of porting it to Pro, but that apparently hasn't happened yet. So either do it in ArcMap (using the Addin) or use the script in Pro.
... View more
08-25-2022
02:42 AM
|
1
|
1
|
1857
|
|
POST
|
I think you're mixing up your terms. In ArcGIS, and I believe in most database management systems, "column" (or "field") means the vertical parts of a table, while "row" means the horizontal parts. More info: https://pro.arcgis.com/en/pro-app/latest/help/data/tables/tables-in-arcgis-pro.htm "Joining two tables" means adding some or all columns of Table1 to Table2, based on the equalness of a column in both table. More info: https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/add-join.htm Based on your mixup, I think you might be interested in appending Table1 to Table2. This takes all rows of Table1 and copy/pastes them into Table2. More info: https://pro.arcgis.com/en/pro-app/2.9/tool-reference/data-management/append.htm If you want to add new rows manually, it depends on whether you work with a pure table or a table with a geometry field (Shapefile or Feature Class). For tables: open the attribute table, scroll down click where it says "Click to add new row" A new row gets created, you can input your values. Save your edits For Feature Classes: open the feature creation panel in the panel, click on the feature template you would like to create. If you click on the arrow to the right, you can input the attributes of the feature. Choose one of the geometry creation methods and draw your feature on the map. FInish by clicking on the button, pressing F2 or double-clicking. Save your edits.
... View more
08-25-2022
12:05 AM
|
1
|
2
|
31463
|
|
POST
|
You could return a json string representation of the dictionary: var d = Dictionary('Accounting', $feature.AssessmentID)
return Text(d) But the problem isn't with the expression. You want to use the output dictionary somewhere and that is what's causing the error. Can you tell us what you're trying to do? If we know what you're working with and what you want to accomplish, it's much easier to help.
... View more
08-24-2022
11:34 PM
|
0
|
3
|
2340
|
|
POST
|
Yes, exactly. You can not work with the feature class in ArcMap. What you can do is create a database view or query layer (in an Enterprise GDB). This view will be viewable (but not editable) in ArcMap.
... View more
08-24-2022
06:46 AM
|
1
|
1
|
2200
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 01-30-2023 09:57 AM | |
| 1 | 05-18-2023 12:51 AM | |
| 1 | 03-05-2023 12:46 PM | |
| 1 | 12-07-2022 07:01 AM | |
| 1 | 06-21-2022 08:27 AM |
| Online Status |
Offline
|
| Date Last Visited |
02-03-2024
06:14 PM
|