POST
|
Aha this is a little bit tricky. I will attempt to write the basic version of this but there are so many edge cases that this script doesn't solve. (Moving feature, deleting a bunch of features at once) .. But this is just a start.. Two classes polygonClass pointClass On the pointClass add an attribute rule on insert //on insert
//check if we are intersecting a polygon. If yes, set the hasPoint field on the polygon to Yes
var fsPolygon = FeatureSetByName($datastore, "polygonClass", ["globalId"], false);
var intersectedPolygons = Intersects (fsPolygon, $feature);
var polygonFeature = null;
for (polygonFeature in intersectedPolygons) break;
if (polygonFeature == null) return $feature.field; // no polygon intersected found , quit..
//we found a polygon feature set its HasPoint to Yes
return {
"result": $feature.field,
"edit": [
{
"className" : "polygonClass",
"updates": [
{
"globalId": polygonFeature.globalId,
"attributes": {"hasPoint": "yes" }
}
]
}
]
} On the pointClass add another attribute rule on Delete //on delete
//check if we are intersecting a polygon. If yes, make sure we are the last point, if yes set hasPoint to No!
var fsPolygon = FeatureSetByName($datastore, "polygonClass", ["globalId"], true);
var intersectedPolygons = Intersects (fsPolygon, $feature);
var polygonFeature = null;
for (polygonFeature in intersectedPolygons) break;
if (polygonFeature == null) return $feature.field; // no polygon intersected found , quit..
//query the pointClass
var pointGlobalId = $feature.globalid;
var fsPoint = FeatureSetByName($datastore, "pointClass", ["globalId"], false);
var intersectedPoints = Filter(Intersects (fsPoint, Geometry(polygonFeature)), "globalId <> @pointGlobalId"); // find all points that are not me in the polygon
//there are still few points, quit!
if (Count(intersectedPoints) > 0) return $feature.field
//$feature was the last point, .. set hasPoint to No
//we found a polygon feature set its HasPoint to Yes
return {
"result": $feature.field,
"edit": [
{
"className" : "polygonClass",
"updates": [
{
"globalId": polygonFeature.globalId,
"attributes": {"hasPoint": "no" }
}
]
}
]
}
... View more
01-27-2020
07:46 AM
|
2
|
5
|
1298
|
POST
|
The correct way of implementing this is little bit more complicated. The easier way can be by having one rule on the polygon class that activates on insert/update and does the query and populate the field. but the problem with this approach is if you move the points then the polygon fields are no longer consistent, you will have to go and make a bogus edit to the polygon to activate the attribute rule. assume you have the following schema polygonClass (fields: hasPoint) pointClass1 //rough script on the polygon class to the hasPoint field
var fsPointClass1 = FeatureSetByName($datastore, "PointClass1", ["objectid"], false);
if (Count(Intersects(fsPointClass1, $feature)) > 0)
return "yes"
else
return "no"
... View more
01-24-2020
01:01 PM
|
1
|
9
|
2499
|
POST
|
Assume you have a user called "gdb" and you connected to the workspace with "gdb" user , you can create the attribute rule using FeatureSetbyName ( "gdb.dbo.TreeTable" ). You can also just say FeatureSetbyName ( "TreeTable") (you can do that because gdb owns the table). Regardless what you write we will ALWAYS persist it internally fully qualified "gdb.dbo.TreeTable" If a user "test" try to connect to the workspace and tried to execute the attribute rule (made an edit) then it will query the table "gdb.dbo.TreeTable" which means test must have access to the table "gdb.dbo.TreeTable"
... View more
01-24-2020
10:55 AM
|
0
|
0
|
2499
|
POST
|
Hey Andrew, Yes you only add the "gdb.DBO." prefix if you are not the owner of the dataset. if you owner the dataset you can just use the name of the class. Attribute rules are considered schema change so all connections should be closed before a change can be done.. this includes stopping services. (Exclusive lock required) You can add them to any dataset with any registration type versioned or unversioned.
... View more
01-24-2020
10:05 AM
|
1
|
2
|
2499
|
POST
|
Hey Andrew, That error means that FeatureSetByName could not find the table name {FC} Means the table {FC} could not be found. Can you paste your script and a picture of your geodatabase schema? The `$datastore` global in FeatureSetByName must be your geodatabase workspace, so make sure that the table Name you specify is the physical table name in your geodatabase not the layer name. Hope that helps Here is a video of the talk I gave back in Dev Summit 2019 in Attribute rules with demos from scratch Attribute Rules in Arcade Video | Esri
... View more
01-24-2020
07:19 AM
|
1
|
4
|
2499
|
POST
|
Hey Juul, Thanks for your feedback. The utility network allows only one session to be validating on DEFAULT at a time. When performing a validate topology on the DEFAULT version the validate operation acquires a lock and starts working, any other validate attempts will fail with the error you outlined above if a validate session already running. At 1:20 scale the validate process should quickly finish, so something isn't right. We would like to know more details, here are few questions 1. What version of ArcGIS Server/Pro are you running? 2. How many features (roughly in the 1:20 scale)? 3. How many dirty areas in the 1:20 scale? 4. How many total error features you have in the utility network (you can find that out in network properties) Meanwhile for a workaround you can simply stop the validate process to release the serialized lock. That can be done by either restarting the feature service or setting a lower usage timeout on arcgis server for that particular feature service (Default is 10 minutes I think) Hope that helps Hussein
... View more
11-15-2019
02:04 PM
|
0
|
2
|
1860
|
POST
|
Pro 2.4.2 is now live and should fix this problem. Thanks for reporting this and again apologies for taking this long, the patch is large and has a lot of good performance fixes across the entire system not just utility network. -Hussein
... View more
10-03-2019
10:03 AM
|
0
|
0
|
491
|
POST
|
Hey Joep, We are in the process of building and verifying 2.4.2, shooting for end this week or early next week. Will update the thread when its out. Apologies for taking this long, the patch is large and has a lot of good performance fixes across the entire system not just utility network. It is equivalent to a DLC in video game speak. Thanks! Hussein
... View more
09-09-2019
07:15 AM
|
0
|
0
|
957
|
POST
|
Hello Aaron, The utility network is a services framework. That means we expose a set of REST APIs that can be consumed from multiple clients. The first client of those APIs was ArcGIS Pro, and other clients are catching up such as ArcGIS Runtime and Javascript API. ArcGIS Runtime 100.6 update will include the first cut of utility network sdk. Some apps such as collector and explorer will be updated in the future to support some sort of utility network capabilities based on the context of the app. That being said, this doesn't stop users from writing their own code to hit those REST APIS directly. Take a look at this blog post I authored showing how can we use javascript to hit utility network api A technical walk-through for a simple utility network web trace tool with Javascript EDIT 10/8/2019 UtilityNetwork API for Runtime is available on 100.6 read blog here Hope that helps -Hussein
... View more
08-21-2019
10:55 AM
|
4
|
0
|
341
|
POST
|
If you go back to 2.3.x you should be to work normally. The bug is in the 2.4 client. I don't have an exact date on 2.4.2 but will be sometime in August.
... View more
08-02-2019
12:47 PM
|
0
|
7
|
957
|
POST
|
Hey Kevin, We have found the problem with Pro 2.4 consuming utility network that are published to 10.6.1/10.6 services. We are planning to bring the fix to 2.4.2 Please confirm that you are on the same environment so we make sure that we covered all cases.. Thanks! Hussein
... View more
08-02-2019
12:07 PM
|
0
|
12
|
2254
|
POST
|
Hey Killian, can you provide the fiddler logs of update subnetwork? I think one of the calls before update subnetwork is failing and the software is giving a generic error message. We were trying to catch this bug for long time, if you have a repro case it will be great. Also tell us if you are updating subnetwork in a version or in default that will help. Thanks p.s. I contacted support with the same request. -Hussein
... View more
07-25-2019
11:15 AM
|
0
|
0
|
2253
|
POST
|
Hey Damien, Are you able to reproduce this? One way we think this could happen if Pro is left idle for a long time (4 hours+) which causes the session to expire after which editing fails. We are working on a fix for this particular case. A workaround is closing and reopening Pro should obtain a new session and fixes the problem. It will be great If you have a repro case to get so we can correct it accordingly. And thanks for sharing this, it is useful for us to keep the quality of the software. -Hussein
... View more
03-12-2019
12:55 PM
|
0
|
3
|
1612
|
POST
|
Glad that worked Ed, I still would like to know why the original approach didn't work for you, because there could be a lurking bug that we have been chasing for a while. I'm assuming you were using a special publishing map Gas Utility Network, so you can get advantage of the symbologies that comes with the model and then you repaired that map to point to your dataset correct? Can you compare the subtypes for each layer between the service that works and the service that doesn't ? You can do that by adding both services to Pro (two different maps and just compare each layer)
... View more
12-18-2018
07:02 AM
|
1
|
1
|
765
|
POST
|
Hi Edward, Can you provide which version of Pro and server? Also, can you try publishing a brand new feature service by doing the following? I want to eliminate certain variables 1. Connect to your geodatabase and make sure the connection is branch 2. Right click on your utility network dataset and select add to a new map 3. Say yes to the prompt to add all layers 4. Publish as feature service and enable the version management server and make sure to enable default for Zs 5. Use this service and see if you still see the errors. Would you mind sharing an asset package with us as repro case?
... View more
12-17-2018
09:23 PM
|
1
|
3
|
765
|
Title | Kudos | Posted |
---|---|---|
1 | 05-02-2024 08:35 AM | |
1 | 04-25-2024 09:20 AM | |
1 | 08-08-2022 10:29 AM | |
1 | 03-11-2024 01:09 PM | |
1 | 03-08-2024 10:51 AM |
Online Status |
Offline
|
Date Last Visited |
yesterday
|