|
POST
|
Unless something's changed in the past few versions, the "Point", "Polyline" etc. classes are still in there and work just like the combined classes in ArcMap.
... View more
02-27-2025
02:33 PM
|
0
|
0
|
2755
|
|
POST
|
If the issue is handling things from the command line properly, your script can look at sys.orig_argv to see if it was called from Pro or not and then use a proper argument processor to feed parameters into "main" instead of arcpy. You can also get parameters in text form using sys.argv[1:], this should be consistent regardless of who called your script file. If you really want to get into the weeds, geoprocessing modules have all the features of regular Python modules so you can write proper entry points and do python -m my_module arg1 argn on top of all the other benefits of modules.
... View more
02-27-2025
02:05 PM
|
1
|
1
|
1854
|
|
POST
|
Instant apps are confirmed for Enterprise 12 as per this blog post, it's configurable apps that got the axe. Instant apps and ExB use the same JavaScript SDK under the hood so I doubt one will disappear before the other.
... View more
02-25-2025
03:13 PM
|
1
|
0
|
1794
|
|
POST
|
Adding on to this, you can use an Arcade expression to smash several fields into one, I've found this just as easy to create and maintain as standard 2 or 3-field symbology.
... View more
02-25-2025
03:09 PM
|
1
|
1
|
3339
|
|
POST
|
Give your script a "main" function (call it whatever you like) that takes in parameters in their final form, then feed it processed parameters behind a main guard. For example: import arcpy
CODE_MAP = {
"North": "N",
"South": "S",
"Other Code": "Other"
}
def main(code: str):
arcpy.AddMessage(f"The code is: {code}".)
if __name__ == "__main__":
full_code = arcpy.GetParameterAsText(0)
short_code = CODE_MAP.get(full_code, "N/A")
main(short_code) This pattern has other advantages, like making it easy to call the function without a script tool wrapper, write tests, and so on.
... View more
02-25-2025
02:23 PM
|
3
|
3
|
1933
|
|
POST
|
Without access to some data I can't say for sure what's going on here. That said, using early returns with else/if chains is an odd coding pattern, you usually either do early return like this: def AdjustFCV(PropType,Land,Imp):
homestead = ("500","501","502")
if Land == "NULL" or Imp == "NULL":
return 0
if PropType == "Vacant Land" and Imp in homestead and Land not in homestead:
return Land
if Land in homestead or Imp in homestead:
return 0
return Land Or use a return value like this: def AdjustFCV(PropType,Land,Imp):
homestead = ("500","501","502")
retval = Land
if Land == "NULL" or Imp == "NULL":
retval = 0
elif PropType == "Vacant Land" and Imp in homestead and Land not in homestead:
retval = Land
elif Land in homestead or Imp in homestead:
retval = 0
return retval I know this doesn't answer why the code isn't behaving right but you should have another working code block at the very least. One last thing: does your data store null values as the string value "NULL"? If not, you'll want to compare your data to the None object, otherwise you won't catch those nulls. Here's that one line adjusted to check for nulls: if Land is None or Imp is None:
... View more
02-24-2025
05:46 PM
|
0
|
1
|
3330
|
|
POST
|
Survey123 will always fall apart if you have duplicate field names, even if those fields are ultimately mapped to disjoint tables. I like to add a small prefix to the fields in repeats (like "e_" for the equipment repeat) to avoid collisions I think that should work in your case as well.
... View more
02-24-2025
03:46 PM
|
1
|
0
|
933
|
|
POST
|
The polyline feature class was Z-enabled but the Polyline object to insert into the feature class was not, this is what I corrected on line 17 of my listing.
... View more
02-19-2025
11:40 AM
|
1
|
0
|
2597
|
|
POST
|
You need to specify that your Polyline object is Z enabled, even if you pass in three dimensional points. This is because the third dimension could be Z values or M values. I've also added a spatial reference where necessary. Please see this corrected excerpt of your code: sr = arcpy.SpatialReference(6679)
# Create a polyline feature class
feature_class_name_polyline = "counties_polyline"
arcpy.CreateFeatureclass_management(
out_path=gdb_full_path,
out_name=feature_class_name_polyline,
geometry_type="POLYLINE",
has_z="ENABLED", # Enable Z values
spatial_reference=sr
)
# Create polyline geometry with Z values
array_polyline = arcpy.Array([arcpy.Point(1000.0, 2000.0, 50.0),
arcpy.Point(1500.0, 2500.0, 75.0),
arcpy.Point(2000.0, 3000.0, 100.0)])
polyline = arcpy.Polyline(array_polyline, has_z=True, spatial_reference=sr)
# InsertCursor to add new polyline geometry
with arcpy.da.InsertCursor(os.path.join(gdb_full_path, feature_class_name_polyline), ['SHAPE@']) as cursor:
cursor.insertRow([polyline])
... View more
02-19-2025
09:48 AM
|
1
|
2
|
2603
|
|
BLOG
|
If you have a more regular set of nested data you can also one line it with a comprehension: z =[[[1, 2], [3, 4]]]
// We can use this generalized form for flattening a list
// where n is the amount of nesting
// and a starts at 0 but increases by 1 every loop
// start = [$0 for $n in z
// while a < n:
// start += for $n-(a+1) in $n-a
// a + 1
// return start + ]
// concrete example for z, which has 2 levels of nesting
[a for c in z for b in c for a in b]
... View more
02-19-2025
09:31 AM
|
1
|
0
|
1194
|
|
POST
|
The last item in the field list for FeatureSetByPortalItem is a boolean value, not a field name. I think you mistyped the return geometry parameter, the fixed line is: var fs = FeatureSetByPortalItem(
fsportal,
"dfc071575e924d5d88cb851eab914222",
0, [
"Total_Daily_Cases",
"Hispanic_or_Latino",
"Not_Hispanic_or_Latino",
"Unknown_Ethnicity",
"Ethnicity_Not_Reported",
"Black_or_African_American",
"White_Race",
"Other_Race",
"Native_Hawaiian_or_Other_Pacific_Islander_Race",
"Asian_Race",
"American_Indian_or_Alaskan_Native_Race",
"Unknown_Race",
"Race_Not_Reported",
"Unknown_Age_Group",
"00_17_Age_Group",
"18_29_Age_Group",
"30_39_Age_Group",
"40_49_Age_Group",
"50_64_Age_Group",
"65_74_Age_Group",
"75__Age_Group",
"Year"
],
false
);
... View more
02-19-2025
08:26 AM
|
2
|
1
|
1812
|
|
POST
|
Couple of options off the top of my head, depending on what you want the output to look like: Run Minimum Bounding Geometry with a convex hull and then buffer those results. Feed the buffer in Union with "Gaps Allowed" unchecked and then into Dissolve.
... View more
02-13-2025
01:21 PM
|
0
|
1
|
1352
|
|
POST
|
Even if you're able to get that Other value into the Rank question, you have to deal with sanitizing the answer so that it's a valid identifier and it'll most likely break the rank display when viewed online. You're best off leaving that rank choice as "Other" and using the "choice_filter" column to only show "Other" if there's a valid answer — you can use this blog post as a reference. For the future you can plead your case in this idea and maybe something will happen.
... View more
02-13-2025
10:50 AM
|
0
|
1
|
1246
|
|
IDEA
|
I agree that join performance in Pro should be re-evaluated, our team noticed such a drastic reduction in performance moving from Map to Pro that we now treat joins as a punishment for anyone who can't write Python scripts rather than a core ArcGIS function. We also use EGDBs extensively so I'd argue that's the best place to start looking for regressions.
... View more
02-13-2025
08:34 AM
|
0
|
0
|
1296
|
|
POST
|
Signature questions are just images with a special interface. You can't get text data out of them and they require a feature layer with attachments enabled as that's where the image is stored. If you need a name with the signature you'll have to make another text question in your form.
... View more
02-11-2025
02:09 PM
|
0
|
0
|
1010
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | Thursday | |
| 2 | Thursday | |
| 1 | Thursday | |
| 2 | a week ago | |
| 1 | 2 weeks ago |
| Online Status |
Offline
|
| Date Last Visited |
Friday
|