|
POST
|
Hello, I am attempting to write a map automation script for ArcGIS Pro. Taking things one step at a time, and so far the script successfully creates some layers, adds them to a specified geodatabase, and then adds them to the current map in the Pro project. I then need to apply symbology to the layers, which I am trying to do using arcpy.ApplySymbologyFromLayer_management. Here is a snippet from my code: aprx = arcpy.mp.ArcGISProject("CURRENT")
m = aprx.listMaps("Primary Map Frame")[0]
m.addDataFromPath(f"{out_gdb}\BackgroundPointsFiltered_{dateTag}")
m.addDataFromPath(f"{out_gdb}\CompliancePointsFiltered_{dateTag}")
m.addDataFromPath(f"{out_gdb}\WorkLocationPointsFiltered_{dateTag}")
in_layer = m.listLayers()[2] # The background points layer that was just added to the map frame
in_symbology_layer = r"R:\gis\.....BackgroundPointsFiltered.lyrx"
arcpy.ApplySymbologyFromLayer_management(in_layer, in_symbology_layer) I've tried many other variations that I've seen from hints on stackexchange and geonet, but none have seemed to work for me. The script doesn't fail, but the symbology doesn't update. What am I doing wrong here? Or is this somehow still related to a bug that I've seen mentioned related to this tool? I'm using ArcGIS Pro v3.0.2
... View more
10-24-2022
05:01 PM
|
1
|
6
|
2912
|
|
POST
|
Yes, I think so....go ahead and try to upload it and see if you still receive an error.
... View more
10-24-2022
04:58 PM
|
0
|
2
|
3683
|
|
POST
|
@DougBrowning I marked your answer as correct because it pertained to my original question about the syntax. Thanks for the help! What I ended up doing was just making the coordinate fields visible and instructing the field crew to make sure they hit the "refresh" icon if they update the position in the map when accessing through the inbox. Not ideal for certain reasons (can't be read-only), but it'll work for now. Thanks again!
... View more
10-24-2022
02:40 PM
|
0
|
1
|
5401
|
|
POST
|
I did some testing, and specifically I think it's an issue with your photos repeat syntax. Put the ${#photos} text within the same table as the rest of the photo repeat information and see if that fixes it for you.
... View more
10-24-2022
02:35 PM
|
0
|
4
|
3689
|
|
POST
|
oh, I'm so happy to hear that! Thanks for the follow up 🙂
... View more
10-24-2022
01:06 PM
|
0
|
0
|
5269
|
|
POST
|
Hmmm, I tried using the syntax "query allowUpdates=true calculationMode=always" and it didn't return the coordinate value when I opened the survey in the inbox. (it does retrieve as expected when I only use "query allowUpdates=true".) For additional context, these Latitude and Longitude fields are pulling values from a geopoint question with a null field type, because I have multiple geopoint questions in my survey. The behavior I'd ultimately like to see is that the fields populate with coordinates when a location is selected on the map in the survey. This point won't be recorded due to the null field type, but the coordinates will. When a user reopens this survey in the inbox if they need to edit something, the coordinates will appear from the original time they selected a location. However, if they click on the map for the null geopoint question and select a new location, I want these coordinates to be updated (hence the calculationMode set to always). I found that without this, these values weren't updating even when a new location was selected in the map. Now that I think about this more, perhaps the calculationMode being set to always is overwriting the value being returned, since the geopoint itself isn't saved so it thinks it doesn't have any geometry input yet. Is there a better way to go about doing this? I was honestly surprised that the coordinates didn't update automatically when a new location was entered, since I thought "calculatioMode=auto" was the default mode for calculations in a survey?
... View more
10-24-2022
11:41 AM
|
0
|
2
|
5443
|
|
POST
|
Hello, I have the text "allowUpdates=true query" in the bind::esri:parameters column for a certain question in my XLS form, as it is my understanding that this is required for a question's value to be retrieved and editable using the inbox functionality with the Survey123 field app. I also want this question to have the parameter set to "calculationMode = always" so that the question will recalculate whenever the geopoint question is updated (it will populate with coordinate values using pulldata from the geopoint). I have tried separating these two parameters with commas and semicolons, but it's not behaving the way I would expect. Can someone please help with the correct syntax that is needed to have multiple parameters listed within this cell, and also if I am understanding the "allowUpdates=true query" statement correctly? Thank you!
... View more
10-24-2022
10:51 AM
|
0
|
4
|
5481
|
|
POST
|
I agree with Josh, it sounds like a method very prone to user error, and I can't think of a benefit to having a multiline question here. I would recommend having unique questions in your survey that are integer or decimal type, and then you can use those fields in calculations in the survey to determine the ratio.
... View more
10-20-2022
12:49 PM
|
1
|
0
|
1327
|
|
POST
|
I attached the XLS form, and here are the Javascript functions I embedded in the survey. function uniqueSpecies (translatedSpecies)
{
var x = translatedSpecies
x = Array.from(new Set(x.split(','))).toString();
return x;
}
function translateSpecies (batString)
{
var text = batString;
var result = text.replace(/ANPA/g, " Pallid bat");
var result = result.replace(/COTO/g, " Townsend's big-eared bat");
var result = result.replace(/EPFU/g, " Big brown bat");
var result = result.replace(/LABL/g, " Red bat");
var result = result.replace(/LACI/g, " Hoary bat");
var result = result.replace(/LANO/g, " Silver-haired bat");
var result = result.replace(/MYCA/g, " California myotis");
var result = result.replace(/MYEV/g, " Long-eared myotis");
var result = result.replace(/MYTH/g, " Fringed myotis");
var result = result.replace(/MYVO/g, " Long-legged myotis");
var result = result.replace(/MYYU/g, " Yuma myotis");
var result = result.replace(/PAHE/g, " Canyon bat");
var result = result.replace(/TABR/g, " Mexican free-tailed");
var result = result.replace(/MYLU/g, " Little brown myotis");
var result = result.replace(/MYCI/g, " Small-footed myotis");
var result = result.replace(/NYMA/g, " Big free-tailed bat");
var result = result.replace(/EUPE/g, " Western mastiff bat");
var result = result.replace(/EUMA/g, " Spotted bat");
var result = result.replace(/MY/g, " Myotis spp.");
return result;
} This might be a helpful references for you: https://community.esri.com/t5/arcgis-survey123-blog/extending-survey123-smart-forms-with-custom-js/ba-p/898782 Also, I didn't do this in my XLS form because I was just testing, but remember to set the bind::esri:fieldType to Null for all of these Javascript and display fields if you don't want these fields to be part of your feature layer attribute table. Also, the fields that are used in the calculations can have "hidden" set as the appearance type so they won't display in the survey. I really hope this helps! And if anyone else comes across this and has pointers, I'm all ears. I came up with this solution as a complete newbie to Javascript (~intermediate familiarity with Python) and referenced StackOverflow a lot...
... View more
10-20-2022
10:37 AM
|
1
|
3
|
5309
|
|
POST
|
So, I had a bit of fun with this "challenge question" and wanted to find a solution, as I am very new to Javascript and wanted to take the opportunity to practice, while also hopefully help someone out. I got a solution to work 🙂 It's almost embarrassing to share since I *know* there are better methods out there and I'm probably not doing it in the most efficient or logical way, but....it works. If you're still needing a solution and want more details, let me know and I'm happy to share the XLS form. Best, Katherine
... View more
10-20-2022
10:12 AM
|
0
|
5
|
5316
|
|
POST
|
Sounds to me like a great scenario for utilizing Operations Dashboards. There are a few things you could do... You can have web maps or web applications show up as "tabs" by stacking them in the dashboard layout. I made the screenshot below very quickly, but I'm sure there are a lot of other configurations you can play around with, like renaming the elements so they don't just say "Map". If you chose this route, it would probably be best to create separate web maps, one for each tab. You would set up the filter based on the "theme" attribute in the web map itself, so that only survey points for those themes would display. The info from the survey would display in the pop-up when the point was clicked on the map. If you don't have to have the "tabs" appearance, there are other things you can do within Operations Dashboard or WebApp Builder by setting up filters that can be activated dynamically via buttons in the dashboard elements or webapp widgets. Maybe that's all you need to get you going in the right direction, but if you have more specific questions I'll try to help! Good luck and have fun 😉
... View more
10-20-2022
07:03 AM
|
0
|
0
|
866
|
|
POST
|
One solution I might suggest is to unshare the surveys so that only the owner and admins will see them. It's not exactly the same as a true "archive", but it will help clear up the clutter for users who aren't admins. I'm not aware of any other type of formal archiving process in AGOL.
... View more
10-19-2022
07:30 AM
|
1
|
0
|
1264
|
|
POST
|
@MattEdrich If you want to post your XLS form and template here or in DM, I'd be happy to take a look and try to help. 🙂
... View more
10-18-2022
08:06 AM
|
0
|
3
|
5447
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | yesterday | |
| 3 | Tuesday | |
| 4 | Tuesday | |
| 1 | Tuesday | |
| 36 | Tuesday |
| Online Status |
Online
|
| Date Last Visited |
yesterday
|