|
POST
|
Hi Billy Guerrero , I can imagine that changing from paper maps to the Utility Network is a huge leap in digital transformation and will requiere proper change management for those that will interact with the UN. However, the benefits that you will have as organization are priceless. How far are you in the process of implementing the UN? I just looked at the 2nd expression you shared and there are a couple of questions and comments I have: I see that you check at the end if the ID is not already set. You might want to do this at the start to avoid processing when it is not necessary This also makes me wonder. What trigger did you define fro this attribute rule? If it is also trigger on update, and a point is moved to another area, the code would change, no only the prefix but also the distance. If you update the code based on these new aspects, you might create a hole in the sequence. Update triggers will need a different way of processing and some considerations of what you want to happen. I have a blog (in Spanish, sorry) of how this could be handled here: CRU2020 - Track Servicios Públicos - Arcade y Reglas de Atributos (although it uses database sequences) I also notice that the format of the id has changed. You seem to increment the distance when a distance is "already in use". Is that correct? I thought that you were creating a postfix that will increment based on the number of id's that are already in use. When I ignore an updates and changes in distance and the prefix, I would think that the logic could be something like this: // check first if the id is already set
var prefix = "W"; // assumably is extracted from a polygon fs
var dist_feet = 551; // dist_degree(...);
var fsPolesRules = FeatureSetByName(...);
var idcode = prefix + Text(Round(dist_feet), '00000');
// create a sql to query all features withe the same start of the assetid
var sql = "assetid LIKE '" + idcode + "%'";
// filter the fs
var fs_filtered = Filter(fsPolesRules, sql);
// use the count to create a new code
var cnt = Count(fs_filtered);
idcode = prefix + Text(Round(dist_feet), '00000') + "-" + Text(cnt+1);
// this will gloriously fail when existing points get moved
// and the id is adjusted to those changes
// return the result
... View more
05-29-2020
08:17 AM
|
0
|
0
|
5922
|
|
POST
|
Hi EatonCountySS , Just to share a little insight in what the expression may look like: // get related records
var fs = FeatureSetByRelationshipName($feature, "Name of the relationship to get to related records");
// sort the related records and get top 2
fs = Top(OrderBy(fs, 'DATE DES'), 2);
// get the latest and previous features
var result = Null;
if (Count(fs)==2) {
var cnt = 0;
for (var f in fs) {
cnt += 1;
if (cnt == 1) {
var f_latest = f;
} else if (cnt == 2) {
var f_prev = f;
}
}
// determine NewCasesToday and calculate increment
var cases_latest = f_latest.NewCasesToday;
var cases_prev = f_prev.NewCasesToday;
result = cases_latest - cases_prev;
}
// return the result
return result;
... View more
05-29-2020
07:13 AM
|
0
|
2
|
5409
|
|
POST
|
Hi Billy Guerrero , Just wondering, but why are you generating an assetid based on the distance in feet from a fixed point? Normally, when automatically creating an assetid, the recommendation is using the NextSequenceValue function in combination with a sequence defined in the database (Create Database Sequence—Data Management toolbox | Documentation ). You also only showed part of the expression and I did not see any part where you return a value. Also, when the data volume starts growing, looping through the entire data will have an impact on performance. If you do need to use the distance for the assetid, use a filter first to only filter those that start with the same id and use the count to generate the new id and not a for loop. Also when there are 10 or more points at the same distance you will run into duplicate codes again with your code.
... View more
05-29-2020
06:05 AM
|
0
|
0
|
5922
|
|
POST
|
Hi atothgwe , In that case you can change the code to this: // define engineering and planning clients
var Eclient = $feature.ENGINEERING;
var Pclient = $feature.PLANNING;
var result = "Engineering Services: ";
if (Eclient == "Y") {
// Engineering client
var flds_engi = ["PLANREVIEW", "WATER", "SANITARY", "STORM", "ROAD", "WATERTREATMENT", "GIS", "ASNEEDED"];
var Eserv = FeatureSetByRelationshipName($feature, "Engineering_2020", flds_engi, false);
var cnte = Count(Eserv);
if (cnte > 0) {
// there are related records, take first (or do you need all?)
Efeat = First(Eserv);
for (var i in flds_engi) {
var fld = flds_engi[i];
var data = Efeat[fld];
if (data == "Y") {
if (result == "Engineering Services: ") {
result += fld;
} else {
result += ", " + fld;
}
}
}
} else {
// no related records
result += "None";
}
} else {
result += "None";
}
result += TextFormatting.NewLine + "Planning Services: "
if (Pclient == "Y") {
// Planning client (is this true?)
var flds_plan = ["CodeBook", "DevelopmentGuidebook", "PublicFacilitation", "MasterPlan", "RecPlan_Grants_Other", "DistrictStudies_Plans", "TIFPlan", "RetainerService", "HourlyServices", "Website", "ZoningAmendments", "StreetScapeDesign", "Wayfinding", "FormBasedCodes"];
var Pserv = FeatureSetByRelationshipName($feature, "Planning_2020", flds_plan, false);
var cntp = Count(Eserv);
if (cntp > 0) {
// there are related records, take first (or do you need all?)
Pfeat = First(Pserv);
for (var i in flds_plan) {
var fld = flds_plan[i];
var data = Pfeat[fld];
if (data == "Y") {
if (result == "Planning Services: ") {
result += fld;
} else {
result += ", " + fld;
}
}
}
} else {
// no related records
result += "None";
}
} else {
result += "None";
}
return result;
... View more
05-29-2020
05:53 AM
|
0
|
9
|
4133
|
|
POST
|
Hi atothgwe , Maybe something like this will work: // define engineering and planning clients
var Eclient = $feature.ENGINEERING;
// var Pclient = $feature.PLANNING; // not being used
var result = "";
if (Eclient == "Y") {
// Engineering client
result = "Engineering Services: ";
var flds_engi = ["PLANREVIEW", "WATER", "SANITARY", "STORM", "ROAD", "WATERTREATMENT", "GIS", "ASNEEDED"];
var Eserv = FeatureSetByRelationshipName($feature, "Engineering_2020", flds_engi, false);
var cnte = Count(Eserv);
if (cnte > 0) {
// there are related records, take first (or do you need all?)
Efeat = First(Eserv);
for (var i in flds_engi) {
var fld = flds_engi[i];
var data = Efeat[fld];
if (data == "Y") {
if (result == "Engineering Services: ") {
result += fld;
} else {
result += ", " + fld;
}
}
}
} else {
// no related records
result += "None";
}
} else {
// Planning client (is this true?)
result = "Planning Services: ";
var flds_plan = ["CodeBook", "DevelopmentGuidebook", "PublicFacilitation", "MasterPlan", "RecPlan_Grants_Other", "DistrictStudies_Plans", "TIFPlan", "RetainerService", "HourlyServices", "Website", "ZoningAmendments", "StreetScapeDesign", "Wayfinding", "FormBasedCodes"];
var Pserv = FeatureSetByRelationshipName($feature, "Planning_2020", flds_plan, false);
var cntp = Count(Eserv);
if (cntp > 0) {
// there are related records, take first (or do you need all?)
Pfeat = First(Pserv);
for (var i in flds_plan) {
var fld = flds_plan[i];
var data = Pfeat[fld];
if (data == "Y") {
if (result == "Planning Services: ") {
result += fld;
} else {
result += ", " + fld;
}
}
}
} else {
// no related records
result += "None";
}
}
return result; Don't return a result inside a loop or condition if you need the expression to continue.
... View more
05-28-2020
05:12 PM
|
0
|
11
|
4133
|
|
POST
|
Hi Scott Stopyak , When you want to use a field calculation that does the job, for this specific case it will be much simpler to use Arcade. You can also create a standalone Python script to do the job, but this might requiere a little more lines of code.It really depends on where the data is stored. If the table and the feature layer are in the same datastore I recommend using Arcade. Is that the case? If there is a way to have access to the data I can have a look at what the expression should look like. You can share the data in a group and invite me to it "xbakker.spx". Arcade has some pretty helpful functions to access related data or filter it and using OrderBy enables you to sort the data by the data and Top will allow you to get the top 2 items and extract the information you are looking for.
... View more
05-28-2020
04:13 PM
|
0
|
3
|
5409
|
|
POST
|
Hi Scott Stopyak , A field calculation would not be a huge things and processing time depends largely on the volume of data that needs to be processed. The frequency of performing the field calculation depends on what best suits your needs. There is not much API involved in this since ArcGIS Pro can directly access the data on AGOL and update it and in Pro you can schedule the field calculation.
... View more
05-28-2020
11:42 AM
|
0
|
5
|
5409
|
|
POST
|
Hi Scott Stopyak , I'm sorry to hear that. Would using a field calculation or defining a scheduled task in Pro be an option you would consider?
... View more
05-28-2020
09:56 AM
|
0
|
7
|
5409
|
|
POST
|
Hola maria ibal , Listo entendido tienes toda la razón. Aunque me pregunto si crees la expresión de Arcade como mencioné antes y la incluyes en este espacio como "{expression/expr0}", esto funcione como campo para la URL o no lo reconoce? Y que pasa si en el despliegue personalizada de los atributos crees un enlace (formato html) que incluye el enlace completo incluyendo las coordenadas?
... View more
05-27-2020
03:03 PM
|
0
|
0
|
3596
|
|
POST
|
Hola Duvan Yahir Sanabria Echeverry , La ubicación registrado por los dispositivos móviles usando el GPS pueden usar la conexión a WiFi y las torres para mejorar la ubicación. 150 m es un error bastante grande, pero esto depende donde se está tomando el dato. Adentro o afuera de un edificio y que "visibilidad" hay a los satélites en el momento de determinar la ubicación.
... View more
05-27-2020
02:54 PM
|
0
|
0
|
2036
|
|
POST
|
Hi NWEdison Team , For now, one of the ways you can do this is to use a field calculation and store the result in a field. However, if your data is dynamic (and in most cases it is) this will requiere repeating the calculation with a certain interval. If you need help with the Arcade expression to do this calculation, just let me know.
... View more
05-27-2020
02:46 PM
|
0
|
1
|
8513
|
|
POST
|
Hi NWEdison Team , Could you elaborate a little more on what you have (what kind of data) and what you are trying to achieve. You can get information of counts in a pop-up, but not dynamically in the symbology without having a field that contains the count.
... View more
05-27-2020
06:23 AM
|
0
|
3
|
8513
|
|
POST
|
Hola Duvan Yahir Sanabria Echeverry , Estás usando GeoForm o Survey123? La ubicación de un dispositivo móvil se hace a través del GPS y muchas veces apoyado en WiFi cuando está disponible y la precisión depende por gran parte de la visibilidad de los los GPS desde el punto donde estás gestionando el formulario. Si estás en un edificio o entre edificios altos, la precisión va ser mucho menor comparado con estar en el campo sin árboles o objetos altos y una visibilidad a los GPS bastante alto. Además, la precisión depende del mismo dispositivo y si estás usando un GPS externo. Para un computador la ubicación se deduce de punto de acceso a Internet y la precisión puede variar mucho. Cuanto distancia hay entre la ubicación del GPS del dispositivo móvil y la ubicación real (y estás dentro o afuera) y que distancia hay entre la ubicación registrado usando el computador y la ubicación real?
... View more
05-27-2020
06:21 AM
|
0
|
2
|
2036
|
|
POST
|
Hi Scott Stopyak , You could use Arcade to calculate the difference, but this would probably requiere a field calculation to use this in an indicator (if that where you want to show it). When I browse through the help for indicators (Indicator—ArcGIS Dashboards | Documentation ), it states this: Reference values on indicators are optional and, when specified, can be thought of as a predefined goal or threshold. There are three types of reference values: the indicator's previous value, a fixed value set at design time, or a statistic calculated at run time. Not sure if this works for your situation.
... View more
05-26-2020
12:58 PM
|
0
|
10
|
5409
|
|
POST
|
Hi Maxime Demers , Let's exclude something first. Your field "matelas_quantite" is numerical, right? Can you also try to change $feature.matelas_quantite to $feature["matelas_quantite"]? There can be some issues when a field contains an underscore in the name. What would work best for me if I had access to the data to detect where things might be going wrong. Is it possible to share the web map and data with me using my AGOL account "xbakker.spx"?
... View more
05-26-2020
08:36 AM
|
0
|
0
|
928
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 01-09-2020 09:26 AM | |
| 6 | 12-20-2019 08:41 AM | |
| 1 | 01-21-2020 07:21 AM | |
| 2 | 01-30-2020 12:46 PM | |
| 1 | 05-30-2019 08:24 AM |
| Online Status |
Offline
|
| Date Last Visited |
4 weeks ago
|