|
IDEA
|
Would be nice to have this as an app-level setting that can be locked off during installation, I'd hate to troubleshoot something a junior tech did because "the computer told me to".
... View more
06-04-2024
03:48 PM
|
0
|
0
|
2085
|
|
POST
|
Manipulating the clipboard like that is a faux pas for user-level programs on any OS, let alone Windows so I doubt it'll ever happen. I recommend keeping a text editor open so you can copy some simple text to clean the clipboard yourself, like a painter rinsing their brushes
... View more
05-28-2024
10:17 AM
|
1
|
1
|
3454
|
|
POST
|
Last time I checked, the Data Access Cursor types return BLOB columns as memoryview objects. The docs for PIL's Image.open function say it can open any file-like object that holds binary data. If you're lucky you can just shove the memoryview in there, if not you can do something like: from io import BytesIO
from PIL import Image
with arcpy.da.SearchCursor(data, fields) as cur:
for row in cur:
data = row[index]
photo = Image.open(BytesIO(data)) I think the issue with the code above is you're decoding the binary data to base64 which is tripping up PIL, assuming your images were added to an attachment table through the standard ArcGIS methods the data is stored byte for byte without any special encoding.
... View more
05-16-2024
02:17 PM
|
0
|
0
|
3087
|
|
POST
|
if not arcpy.GetSigninToken():
fail()
portal = arcgis.GIS("Pro")
... View more
05-10-2024
08:28 AM
|
0
|
0
|
790
|
|
POST
|
The logical endpoint of this is the geoprocessing modules feature, which allow you to bundle your Python toolbox(es) as members of a standard Python package. There's a very big learning curve and you're forced to deal with Python's perpetually half-baked build systems but your reward is a fully managed, easy to read bundle of code that you can load into different environments, complete with proper dependency management. And the toolboxes are accessed just like system tools which is pretty slick. Just watch out for using them in web tools, that's a whole other can of worms.
... View more
05-09-2024
04:54 PM
|
2
|
0
|
4666
|
|
POST
|
The field calculator doesn't use any types that are pass-by-reference, so you have to return what you want like so: def reclass(Date, DateType):
if (DateType == "D"):
return Date[3:5]
return None
... View more
04-26-2024
08:51 AM
|
2
|
1
|
2307
|
|
IDEA
|
Our team has a project that requires all attachments have a very specific name based on a field in the parent feature. We currently "solve" this using a Python cursor to ensure all attachments are named correctly. Not only does this take several hours to chew through the table but every renamed attachment creates a new record in the archive table, effectively doubling the size of every attachment. Enforcing the proper name via Arcade at the database level would solve all of these issues.
... View more
04-25-2024
08:59 AM
|
0
|
0
|
2387
|
|
POST
|
I haven't found a way to do this in Survey123 alone, but if your survey data is backed by an Enterprise Geodatabase you can use Attribute Rules to flip the read-only switch on submission
... View more
04-18-2024
05:26 PM
|
1
|
0
|
1046
|
|
POST
|
It looks like the "modified" property on each service item aligns with when it was last updated. You'll get some false positives for items that were edited after the service was overwritten but this should be good enough for most purposes. Take another look at Carsten's code for tips on getting the date out in a readable format.
... View more
04-15-2024
01:23 PM
|
0
|
0
|
2170
|
|
POST
|
I ran into a similar issue in the past and unfortunately there wasn't a workaround. To my understanding FeatureSetByName must take name of the table as a string literal or it'll create an error. I have to assume there's some hacky pre-processor nonsense that goes on with this function, either way you'll just have to type out the right name for every rule. If you're writing the rule multiple times you might want a script tool that uses Add Attribute Rule to save some time. As an aside, that method of getting the max ID isn't optimal for large datasets, even with an index on the ID field. You may want to look into combining a database sequence with NextSequenceValue to get a new ID in constant time.
... View more
04-08-2024
08:45 AM
|
0
|
1
|
1072
|
|
IDEA
|
This is symptomatic of a bigger problem, which is that everything in Field Maps works off the Smart Form definitions and the APIv4 popup definitions except for Edit Multiple which reads the APIv3 popup definitions (i.e. the "fieldInfos" object at the root of the "popupInfo"). I have a sneaking suspicion this is related to the lack of standardized multi-feature editing in the new API somehow, but either way updating Edit Multiple to use the Smart Form definition is a must, there's no reason for the editing workflows to be disjoint.
... View more
03-22-2024
08:41 AM
|
0
|
0
|
4166
|
|
IDEA
|
Tweaking a layer based on the current datetime relative to a field in the layer is a common request in my org. Usually it's a symbol that we set using Arcade but filtering comes up too and jumping into AGOL Assistant is less than ideal.
... View more
03-20-2024
11:42 AM
|
0
|
0
|
6881
|
|
POST
|
Is your data in an EGDB? You can write a database view that UNIONs every layer into 1 big table with a "score" field, something like: SELECT ROW_NUMBER() [OBJECTID], tbl.[LayerName], tbl.[Score], tbl.[Shape]
FROM (
SELECT 'Layer1' [LayerName], 1 [Score], Shape
FROM A.B.Layer1
UNION
SELECT 'Layer2' [LayerName], 1 [Score], Shape
FROM A.B.Layer2
) tbl You'll have to find the appropriate function to get a unique row number for your database, here's some info for SQL Server. Once the view works you can register it to the EGDB, publish it as a layer and drop that in your app for use with widgets.
... View more
02-01-2024
01:51 PM
|
0
|
0
|
854
|
|
POST
|
Will the changes actually remove records or just some fields? If the row count remains the same across the board, you can download the old data, make the changes, join the old data to the new data on the common key field and then field calculate the old data over to the new format. Whipping up a dummy survey to test the workflow is a good idea, you can never tell what Survey123 might do on schema changes!
... View more
02-01-2024
01:40 PM
|
0
|
1
|
1272
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 4 hours ago | |
| 1 | 4 hours ago | |
| 1 | yesterday | |
| 1 | a week ago | |
| 1 | a week ago |
| Online Status |
Online
|
| Date Last Visited |
6 hours ago
|