|
POST
|
Can anyone attest to the veracity of this statement here? "The hash sign ("#") string is what the geoprocessing framework passes in for unspecified values so you have to look for that in addition to the empty/null string case." stack exchange link I ask because I noticed no one suggesting testing for != "#"
... View more
10-27-2021
06:11 AM
|
0
|
2
|
6031
|
|
POST
|
Hah! So am I, many thanks! What ok curious about is exactly how to set the default to none in the script tool parameter dialogue...I can't believe I've never done that before...
... View more
10-26-2021
03:10 PM
|
0
|
1
|
5782
|
|
POST
|
Ok I see where you are going! I've never set a default to none. Is none a valid input for default or something like "" needs to be set?
... View more
10-26-2021
02:50 PM
|
0
|
3
|
5785
|
|
POST
|
I was thinking something similar but don't know how to implement it exactly. But the trick here is that if a user supplies no value, that is actually valid because they don't want to employ this parameter and this is the most likely scenario. Follow me?
... View more
10-26-2021
02:30 PM
|
0
|
5
|
5793
|
|
POST
|
Here's a crude example to at least put forth some effort in asking this question. I tried searching and got some results but I fear my inquiry is too simplistic to find viable results. Let's say we have just two parameters defined in the code; and in the script tool we have configured parameter 1 to be 'required' and parameter 2 to be 'optional'. RequiredParameter = arcpy.GetParameterAsText(0)
OptionalParameter = arcpy.GetParameterAsText(1) So if your code has a line expecting OptionalParameter, the script will fail. So how best to evaluate it being supplied by the user or not? A few options I have found: Evaluate for presence of the optional parameter: if OptionalParameter and OptionalParameter != "#":
#Do something with optional parameter Try-Except block: try:
#arcpy tool using the supplied optional parameter
except:
pass #move on with life never knowing if anything went wrong or why it did I suppose something could be done within the script tool validation, but the code itself would have to be modified as well. Pitfalls of either? Better options exist?
... View more
10-26-2021
11:09 AM
|
0
|
14
|
11862
|
|
POST
|
Thanks Dan! That's the same doc I linked to as well. I'm able to generate the string, but are the items in the Spatial Reference object indexed so I can parse them out? Are they keyed? The documentation isn't very detailed. Thanks again, you do so much for us!
... View more
10-22-2021
02:54 PM
|
0
|
0
|
1783
|
|
POST
|
I'm trying to create a simple evaluation within a script which does not restrict the spatial reference of the data, but the output is fixed: WGS 1983 Web Mercator Aux Sphere. All inputs will be projected data. I want to project any input data to match the desired output projection, but I need to evaluate the datum of the input vs the output. . Unfortunately, according to the documentation found here, this property (GCSName) is available only for geographic data. However: Because a projected coordinate system is based on a geographic coordinate system, projected coordinate system properties can be accessed from a geographic coordinate system via the GCS property. But the GCS property returns a spatial reference object for which I do not know how to format or parse parameters from to evaluate. Is there a way to do this? This will eventually be rolled-up into a script tool. Any general tips on handling such a process would be greatly appreciated. I anticipate there will only be a handful of input PCS to deal with but it is entirely possible that there both NAD83 & WGS84 datums (3 feet matters for us in this case!).
... View more
10-22-2021
12:49 PM
|
0
|
4
|
1834
|
|
POST
|
I had to go back and stare at that until I understood. FWIW, I avoided using list fields in the tool validation as I was getting an IO error, found a few posts out there and opted for describe instead.
... View more
10-20-2021
09:17 AM
|
0
|
1
|
3302
|
|
POST
|
Thanks Jeff, that's fixed it! any reason why it was working in the python command window?
... View more
10-20-2021
09:02 AM
|
0
|
3
|
3306
|
|
POST
|
Proof of concept task here. I have had success enabling additional parameters if a dependent parameter met a certain qualification like so: def updateParameters(self):
if self.params[5].value == "Supplemental":
self.params[6].enabled = True
else:
self.params[6].enabled = False Now I'd like to do something similar by evaluating the presence of an existing field in the first parameter (a feature layer). If the field is already present, then the following parameter is disabled: def updateParameters(self):
if self.params[0].value:
StandsFields = arcpy.Describe(self.params[0].value).fields
for field in StandsFields:
if field.name == "OS_TYPE":
self.params[1].enabled = False
else:
self.params[1].enabled = True However, the 2nd parameter is present no matter what. Adapting this to a simple Python Window session works however: StandsFields = arcpy.Describe(FC).fields
for field in StandsFields:
if field.name == "OS_TYPE":
print("True")
True I've been searching around quite a bit here but no luck. Just barely getting into script tool validation. Any help is very much appreciated!
... View more
10-20-2021
08:35 AM
|
0
|
7
|
3315
|
|
POST
|
Go see my response to your thread. You are not alone!
... View more
09-30-2021
11:58 AM
|
0
|
0
|
11901
|
|
POST
|
@KellyArmstrong I spent all morning dealing with this with Esri, an Esri partner we've contracted in the past who services Esri clients, a 3rd party vendor (who is also an Esri partner), and our IT department. If you want the background to this here's an article describing what is happening: https://techcrunch.com/2021/09/21/lets-encrypt-root-expiry/ For an Android phone’s built-in browser, the list of trusted root certificates comes from the operating system — which is out of date on these older phones,” Let’s Encrypt explains. “However, Firefox is currently unique among browsers — it ships with its own list of trusted root certificates. This was a clue for us. Note the Sept 30th expiration. Steps taken: This was only impacting our Android devices; all other access to Enterprise is fine. Esri verified the health of the system, certs etc. Determined was IT issue. Conferred with an Esri Partner that supports Esri client infrastructure & development and indicated several clients facing odd cert issues starting last night as well. Within the Android device, only mobile apps faced this cert issue: 3rd party app, Field Maps, Collector. See attached error messages. Using Chrome on the mobile device you could access the Portal site and authenticate just fine. Using the ‘default’ browser (in my case ‘Samsung Internet’) you could NOT access the site and a similar certificate error displayed. Tried installing Firefox app and making default in hopes that the apps would ‘look’ at the new Root certs but the behavior persisted. iOS devices are not impacted. Current workaround (your experience will vary a bit depending on your android version(s) and what browser you use on your desktop; Firefox used here did not try with other browsers): Manually install R3 cert to device From desktop: navigate to your portal URL and view, cert info click on padlock icon next to the portal URL Click More Information View Certificate Click the R3 tab and scroll down to 'Miscellaneous' and download PEM(cert) Get this to your Android device by your favorite means (email, file share, Drive, etc.) Back on Android device: Settings>Biometrics & security > Other security settings> Credential Storage Install from phone storage> (on my device i select CA certificate, on other tablets it didn't have an option but import worked as expected; I didn't need to supply a name but they did and named it something appropriate)> maybe a warning > install the thing >reboot > open app and see if error clears. This fixed Collector and Field Maps but so far not the 3rd party Esri app. I expect this may have far reaching impacts for Esri Partner devs.
... View more
09-30-2021
11:56 AM
|
3
|
1
|
11710
|
| Title | Kudos | Posted |
|---|---|---|
| 9 | 03-24-2026 11:41 AM | |
| 1 | 11-06-2024 06:58 AM | |
| 1 | 12-16-2022 07:01 AM | |
| 1 | 08-09-2024 06:55 AM | |
| 1 | 08-13-2024 05:58 PM |
| Online Status |
Offline
|
| Date Last Visited |
03-24-2026
12:51 PM
|