|
POST
|
Hi Daniel, You should be able to just take the json that's shown in your screenshot, grab the "results" and take the first result in the list doing something like this: Just un-nesting the json response essentially. Josh
... View more
04-20-2023
02:27 AM
|
0
|
3
|
2203
|
|
POST
|
Hi LT, I don't believe that's possible when creating features in ArcGIS Pro. I think the only "select multiple" available in the ArcGIS Platform is via Survey123 - not sure if that's possible or useful in your situation though! Otherwise you may have to split it into multiple fields as you suggested.
... View more
04-20-2023
12:05 AM
|
1
|
0
|
3209
|
|
POST
|
Hi, There's a button at the bottom of the "Field Calculator" dialogue box called "Enforce Domains" - your problems should be solved by ensuring it's checked before running your calculation https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/calculate-field.htm
... View more
04-19-2023
11:59 PM
|
0
|
14
|
3051
|
|
POST
|
Hi Will, From looking at the api I think the bio is the "description" for a user. If so, the following code should do the trick: from arcgis.gis import GIS
gis = GIS("home")
users = gis.users.search(max_users=500)
for user in users:
email = user.email
user.update(description = email)
#bio = user.description
#bio = email + "\n" + bio
#user.update(description = bio) I've included a couple commented out lines there just in case you want to keep the user's current bio and just put the email on a line in front of it, otherwise it'll just be overwritten! Just run it from an ArcGIS Notebook in AGOL/Enterprise. And if you want to test that it'll do what you're intending it to do you can put a print statement in there in place of the user.update. Hope that helps. Cheers, Josh
... View more
04-19-2023
11:55 PM
|
3
|
0
|
826
|
|
POST
|
Hi Al, I'd definitely recommend keeping all of the data in the same table and having a drop down. Where are you aiming to display the data, in a web map in ArcGIS Online? You can set up filtering on a layer within web maps in AGOL, and ArcGIS Dashboards and Web Experience Builder/Web App Builder also have filter tools that would allow a user to query the data in a drop down box as they please. You may also just want to consider symbolising on the species field so you can easily see which species are where - Field Maps also now allows for the configuration of filtering by specific fields in a layer which would allow your data collectors to see the points for a specific species in the field too. Cheers, Josh
... View more
04-14-2023
06:41 PM
|
0
|
0
|
2438
|
|
POST
|
Have you confirmed that the intersect outputs what you want it to when you run it manually? I've updated the user above's code to store unique names for the input county/counties and print them at the end. aprx = arcpy.mp.ArcGISProject("CURRENT")
m = aprx.listMaps("Map")[0]
county = ["Dude County"]
projectfilepath = "C:\\Users\\User\\Documents\\ArcGIS\\Projects\\ARCPY_test\\"
datafilepath = "C:\\Users\\User\\Documents\\ArcGIS\Data\\"
to_KMZs_filepath = "Circuits_KMZs\\"
parcel = "Counties_(v17a)"
gdb = datafilepath + to_KMZs_filepath
counties = m.listLayers(parcel)
import os
fields = ["LABEL", "NAME_1"]
names = {}
for dirpath, dirnames, filenames in os.walk(rootdir):
for file in filenames:
if file.endswith("kmz"):
try:
arcpy.conversion.KMLToLayer(
in_kml_file = m.addDataFromPath(os.path.join(gdb,file)),
output_folder = projectfilepath,
output_data = file + "_LAYER",
include_groundoverlay="NO_GROUNDOVERLAY"
)
line = m.listLayers(file + "\Polylines")
tmp_int = arcpy.analysis.Intersect(
in_features = [counties, line],
out_feature_class = r"memory\temp_intersect",
output_type = "POINT"
)
with arcpy.da.SearchCursor(tmp_int, fields) as s_cursor:
for label, name_1 in s_cursor:
if label in county: # remove this conditional and adjust the indents below for it to include all counties in the intersect
print(f"{name_1}")
if label not in names: #if county not present as key in dictionary add it and add first name_1 value as a list
names[label]= [name_1]
print(f"Added {label} and {name_1} to names dictionary")
else:
if name_1 not in names[label]: #if county present as key and name_1 not in list of names, add it
names[label].append(name_1)
print(f"Adding {name_1} to {label} in dictionary")
else: #if name already in list of names for county key in dict, don't add it
print(f"Not adding {name_1} as already present in dictionary")
except Exception:
arcpy.AddMessage(os.path.join(rootdir, file))
# print the final message
for k, v in totals.items():
print(f'County: {k} | names: {v}') The temp layers will always be overwritten with the above code because the output name is the same every time it's run, what we're doing here is extracting the information we want from the temporary layer, storing it to a dictionary outside of the for loop (so it's persisted) and then looping through the dictionary values at the end.
... View more
04-14-2023
03:16 PM
|
1
|
0
|
1938
|
|
POST
|
Hi, I think the structure of your data is fine as it gives you the granularity you would need to chain multiple selectors and filter down to the specific data you're interested in! Probably the best way to do this is to add multiple "Category" selectors (one for each variable) set to "Grouped" values and pointing to the respective fields you're wanting to filter by, so one Wind selector pointed at the "Wind" field etc.. With the grouped values this will a drop down where you can choose "True" or "False" and it will filter the rest of the data in your dashboard, once you've configured that in the "Actions" portion of the selector setup.
... View more
04-14-2023
02:21 AM
|
0
|
0
|
570
|
|
POST
|
Adding to the above poster's comment, if you're doing this in a smart form/Field Maps, then you can just edit the final line to be this: IIF($editcontext.editType == "INSERT", nearStation.station_name, destinationField) With destinationField being the field you're writing the station name to. Which will mean that if a point is being added for the first time it will do the intersect and populate the field with the closest station, but if it's an update/edit then it just returns the current field value.
... View more
04-14-2023
12:28 AM
|
0
|
0
|
739
|
|
POST
|
Hi, Do you just need to indent from the "fields" line down? With the search cursor outside of the for loop it'll keep overwriting the "memory\temp_intersect" output for each KML and then just run the search cursor over the final KML layer that is intersected. Although this would print out the values for each KML separately which it doesn't sound like you want the output to be. If you do want it all in one final search cursor, you could output each temp intersect layer with a different name (so it's not overwritten every time), then add a merge above the "fields" line to bring them all together, and use the merged layer as the input into your cursor?
... View more
04-14-2023
12:17 AM
|
1
|
0
|
1977
|
|
POST
|
Hi Abhishek, I've just downloaded a csv from the open data site you linked and despite the fields being labelled x/y those are latitudes and longitudes (x=longitude, y=latitude). And in the reverse geocode example you posted the results are in WGS84 (WKID4326) which is latitude and longitude. You can plug them into google maps and it will work, I've done this with the top row of the csv below
... View more
04-07-2023
03:45 PM
|
2
|
0
|
1920
|
|
POST
|
My pleasure, glad that worked and that I could help out! I am also eagerly awaiting the day that attribute rules are supported, but glad this is an interim solution at least!
... View more
04-06-2023
01:01 PM
|
0
|
0
|
5751
|
|
POST
|
Weird, outputting the layer using feature class to feature class and storing it in the 'memory' workspace may be a decent option for temporary data, but if your process of outputting to a .lyrx is working then all good I guess!
... View more
04-06-2023
12:33 AM
|
0
|
1
|
11239
|
|
POST
|
Hi, If it's not automatically adding it you may be able to sandwich it within the following code to get it to add to the map - haven't tried it myself but it's the manual way of adding a layer to a map. myProject = arcpy.mp.ArcGISProject("CURRENT") #references current pro project
myMap = myProject.activeMap
#the rest of the code
myMap.addLayer(outputLayer)
... View more
04-06-2023
12:19 AM
|
0
|
3
|
11252
|
|
POST
|
Hi, If you're running it from within Pro then MakeFeatureLayer should automatically add it to your active map. Although in testing this I've realised that MakeFeatureLayer doesn't honour the selection which is annoying. Does it have to be a temporary layer? If not then exporting to feature class should work https://pro.arcgis.com/en/pro-app/latest/tool-reference/conversion/feature-class-to-feature-class.htm If not you will need to take the selected features on the input and add their ObjectIDs to the where_clause in the MakeFeatureLayer function. This should work: inputLayer = 'yourlayername'
outputLayer = 'outputlayername'
OIDS = arcpy.Describe(inputLayer).FIDSet #returns a string of all the OBJECTIDs
sql = "OBJECTID IN ({})".format(OIDS.replace("; ", ",")) #formats the OBJECTiD string into the format of (1, 2, 3) required for SQL IN
arcpy.management.MakeFeatureLayer(inputLayer, outputLayer, where_clause=sql)
... View more
04-06-2023
12:00 AM
|
2
|
7
|
11254
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-22-2023 10:37 PM | |
| 1 | 04-05-2023 11:09 PM | |
| 1 | 05-21-2024 10:26 PM | |
| 1 | 04-20-2023 12:05 AM | |
| 1 | 05-21-2023 10:47 PM |
| Online Status |
Offline
|
| Date Last Visited |
03-20-2025
08:52 AM
|