|
POST
|
Looks like you're getting the date in a string format, probably month/day/year. Take a look at the strptime method I mentioned above, you can parse the date string that way.
... View more
01-09-2025
11:12 AM
|
0
|
0
|
2163
|
|
POST
|
I have a feeling specifying a field length is tripping it up. This is what Pro spits out as a default Python command for adding a "Long" field, you should be able to tweak this: arcpy.management.AddField(
in_table=toFeatureClass,
field_name="LOCALITY",
field_type="LONG",
field_precision=None,
field_scale=None,
field_length=None,
field_alias="Locality",
field_is_nullable="NULLABLE",
field_is_required="NON_REQUIRED",
field_domain=""
)
... View more
01-09-2025
11:09 AM
|
2
|
1
|
2218
|
|
POST
|
Odd, I guess a nonstandard character snuck into my answer. Try typing it out by hand and it should work, or at least you'll get a better error message. I wouldn't trust the date it reports until all the other errors are solved.
... View more
01-09-2025
11:02 AM
|
0
|
2
|
2168
|
|
POST
|
You'll need to extract that weather API's geometry format, convert it to the appropriate arcpy Geometry object, then feed that into your Insert Cursor using the magic "SHAPE@" field token. A hypothetical: import json
fields = ("key", "SHAPE@")
crs = arcpy.SpatialReference(4326)
with arcpy.da.InsertCursor(existing_feature_class, fields) as cur, open(my_json_file) as f:
data = json.load(f)
for obj in data["features"]:
key = obj["id"]
points = arcpy.Array([arcpy.Point(pt["x"], pt["y"]) for pt in obj["polygon"]])
shp = arcpy.Polygon(points, spatial_reference=crs)
cur.insertRow((key, shp)) The exact method you use to extract the info and turn it into data arcpy can work with will differ based on what the API is returning, it's up to you to interpret their format correctly. As for automating, if you build a feature class properly you can continue to load it with data from many input files. Alternatively, you can build a new feature class from scratch each time. Arcpy has all the tools to get you from point A to point B, play around a bit and you should find a solution.
... View more
01-09-2025
10:53 AM
|
0
|
1
|
1813
|
|
POST
|
Your expression is calculating the difference between the current day of the month and the permit date, which probably isn't what you want. Try(datetime.datetime.now() - !permitissdate!).days instead. On top of that, you'll want utcnow instead of now if your permit dates are stored in UTC instead of a consistent local time. Either way, this ran with no issue in Pro 3.1. If you're using ArcMap or a much older version of Pro the Field Calculator brings dates in as formatted strings instead of datetime objects. To fix this you'll need to parse that string in whatever format is spat out using the datetime.datetime.strptime method.
... View more
01-09-2025
10:39 AM
|
0
|
4
|
2173
|
|
POST
|
Take a look into the built-in json library to convert the API results into a dictionary, then you can extract the values you need and feed it into a feature class (existing or new) with an Insert Cursor. You'll also have to create your feature class in the data's coordinate system or project the incoming data to match your feature class's CRS.
... View more
01-09-2025
10:01 AM
|
0
|
3
|
1835
|
|
POST
|
Take a look at Organizational Collaboration, if your Enterprise service meets the requirement it's the easiest way to get that data into your Online portal.
... View more
01-09-2025
09:50 AM
|
0
|
0
|
1799
|
|
POST
|
This code block function will preserve the original order: def dedupe(item_str):
cleaned = []
for item in item_str.split(","):
if item not in cleaned:
cleaned.append(item)
if len(cleaned):
return ", ".join(cleaned)
return "" Change the strings on lines 3, 7 & 8 as needed to fit your data.
... View more
01-09-2025
09:22 AM
|
1
|
2
|
2770
|
|
POST
|
To refer to an existing notebook with a static location, browse to the notebook file in the Catalog and Right Click → Add To Project. But I assume that's not what you're looking for and you want the users to retain a copy of a "master" file in their own projects. In that case: def import_notebook(project_path: str = "CURRENT"):
from os import path
import shutil
SOURCE_BOOK = r"\\the\path\to\the\notebook.ipynb"
prj = arcpy.mp.ArcGISProject(project_path)
new_book = path.join(prj.homeFolder, path.basename(SOURCE_BOOK))
shutil.copy(SOURCE_BOOK, new_book)
return new_book And that's as far as Python can take you (unless I'm missing some obscure CIM method). The Pro SDK has an Add Item method but making an addon just to clone a book properly seems a bit much, you might be better off instructing the user to add the book themselves.
... View more
01-09-2025
09:06 AM
|
0
|
0
|
1535
|
|
POST
|
If you're in ArcGIS Online, you can try using the pulldata function with the roads layer as detailed in this blog post. Alternatively, you can do this database-side if you're on ArcGIS Enterprise. First, make sure the service backing the survey is published using Enterprise Geodatabase data. You can find a guide on pointing your survey to an existing service here and the feature class requirements here. Once you've done that, you now have access to Attribute Rules, which means every new survey can take the road info from the feature, filter the road features to find the matching segment, grab a point from that matching road segment and return that as the new location. The advantage here is you guarantee every new point has been snapped to a road if it exists and it'll also work better in offline situations.
... View more
01-09-2025
08:38 AM
|
0
|
0
|
1121
|
|
POST
|
For reading files, if your script references a file the analyzer should let you know if it'll be copied to the server. They are stored near the tool in the server directories and the path rewriting process should point to the new copies For writing files (and then reading them back), arcpy.env.scratchFolder works just fine with web tools, the service will manage the appropriate directory for scratch work.
... View more
01-08-2025
10:58 AM
|
0
|
0
|
743
|
|
POST
|
If you're able to extract the info you need from the PDF and convert it to an image or two, you can include them as notes per the documentation. Alternatively you can host the file on a web server your company controls and then add a hyperlink in a note. The user will have to switch between Survey123 and their PDF viewer but this will guarantee they have access to the instructions. I haven't found a good way to link directly to items in a Survey's media folder but if you get that working it'll be more robust than an external link.
... View more
01-08-2025
09:44 AM
|
0
|
0
|
3639
|
|
POST
|
Your 3pt offset is introducing the gaps. There might be a workaround somewhere but this feels like a limitation of when the line end calculations are done relative to the offset. If you can't compromise on the line ends then you can Graphic Buffer your polygons and use that copy for publishing
... View more
01-08-2025
08:38 AM
|
0
|
1
|
1678
|
|
POST
|
If you hop in the ArcGIS Online Assistant are you able to extract the dashboard's data? Worst case this'll make it easier to rebuild it.
... View more
01-07-2025
04:43 PM
|
0
|
0
|
1797
|
|
POST
|
Graphics are stored as a layer in the map they belong to. Well, specifically they're stored in a separate file inside the project file that the layer refers to, but that's just for performance reasons. If you right-click on the layer you can use Sharing -> Save As Layer File to keep a copy stashed away, hopefully that's enough to save what you need.
... View more
01-07-2025
02:58 PM
|
2
|
0
|
944
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10 hours ago | |
| 1 | Tuesday | |
| 1 | 05-24-2023 11:47 AM | |
| 2 | 04-09-2026 11:36 AM | |
| 1 | 09-08-2023 10:07 AM |
| Online Status |
Offline
|
| Date Last Visited |
12 hours ago
|