|
POST
|
If you want to run another model (or script tool) using arcpy, use the Import Toolbox function to add the model's toolbox, then run it like so: arcpy.toolbox_label.ModelName(param1, param2). Toolbox items aren't accessible as Python modules and trying to call an exported script file directly is possible, but error prone without practice.
... View more
01-20-2025
08:26 AM
|
0
|
0
|
987
|
|
POST
|
Unfortunately hosted layers will almost always be slower than local file/mobile GDBs. If @EzraBosworth-Ahmet's method doesn't work you can adjust your cursor to use a SQL filter: with arcpy.da.UpdateCursor('featureClassName', ['fieldName'], "fieldName = 'N'") as cursor:
for row in cursor:
cursor.updateRow([None]) Or combine a Select By Attribute with a Calculate Field (you can even do the calculation in SQL to run it on the server in modern Enterprise versions). But yeah, in the general case you're losing performance with cursor updates once the server's involved.
... View more
01-17-2025
02:34 PM
|
0
|
2
|
3329
|
|
POST
|
The official migration plan says to replace this widget with an entire separate web app. Why this is only available as an instant app when both use the exact same SDK and layout system under the hood is beyond me but that's the hand they're dealing. Your best workaround for now is to see if the instant app meets your needs, build it out and embed the app as a page in your experience. If that fails you'll have to plead your case in this Idea and hope someone changes their mind.
... View more
01-17-2025
12:53 PM
|
0
|
0
|
2719
|
|
POST
|
Does the error persist in the map viewer? If so, does resetting the layer properties fix it? Note that this will reset every layer property that only exists in the map, so take note of what you've changed so you can reapply it after the reset.
... View more
01-17-2025
11:26 AM
|
0
|
0
|
2001
|
|
POST
|
The easiest way to work with data from other services is the "Search" method to populate choice lists, this blog post covers everything you need to know. If you need a more complex integration (e.g. pulling the survey's geometry from another service using a matching field value) you'll need to combine the pulldata function with a @layer query, this blog post covers that too. Note that none of these methods play nice with offline data collection as Survey123 won't cache service data ahead of time. If your users are collecting data off the grid then you'll have to use CSV files.
... View more
01-17-2025
11:14 AM
|
1
|
0
|
968
|
|
POST
|
Do you have an equivalent ArcMap output? Looking at how Alaska is projected the grid ticks are placed correctly based on the extreme angular distortion you're employing. If you swap the ticks to full grid lines do they accurately reflect the curvature of the Earth in that location?
... View more
01-17-2025
10:45 AM
|
0
|
0
|
1514
|
|
POST
|
I doubt the app's internal databases will become user-accessible, that's a good way for people to corrupt the app for little gain. As for CSV files, if you link them to portal items you can update a single item and every device will get an update once they regain internet access. You should also be able to download the survey package from your portal using Survey123 Connect, which will save all of the relevant data (including CSV choice lists) to your PC. If you need to manage an entire project within a fully disconnected environment then I'm not sure Survey123 is going to work, although I'd love to hear from people in those conditions about how they work with ArcGIS.
... View more
01-17-2025
09:20 AM
|
0
|
0
|
936
|
|
POST
|
As per tradition, ChatGPT is subtly incorrect: you can't author attribute rules in the Field Maps designer, but if you're using a registered feature service with attribute rules those can work just fine. A couple of things to check: Did you check off "Exclude from application evaluation" for your rule? If you don't enable this option, Field Maps will try to evaluate the rule before submitting any data, which is impossible without the related table on hand. In general, if your attribute rule refers to any data outside the current $feature you must check this box to prevent errors. Another possible issue: FeatureSetByRelationshipClass is a fairly new function and your Enterprise might not fully support it. You may need to use the more available FeatureSetByRelationshipName function to grab your related data.
... View more
01-17-2025
08:42 AM
|
3
|
1
|
1680
|
|
POST
|
What's your Enterprise version? My org is 11.1 with Pro 3.1 and I've created dozens of relationship pairs with a GlobalID from the parent linked to a GUID in the child. Works flawlessly with Survey123 (my primary use case) and I haven't noticed anything break with Field Maps. Worst case you may want to ring up support and work with them to build a reproduction of your workflow, this could easily be some obscure combo of Pro, Enterprise, EGDB and RDBMS versions breaking things.
... View more
01-16-2025
05:01 PM
|
0
|
0
|
2007
|
|
POST
|
You could try something like this in your report's summary section: ${mainLayer | stats:"count,volunteer_name" | returnDistinctValues:true}. The key part being returnDistinctValues to ensure you're only counting unique items.
... View more
01-16-2025
04:49 PM
|
0
|
0
|
1027
|
|
POST
|
Summary Statistics is yet another tool that can calculate the aggregated sums.
... View more
01-16-2025
10:31 AM
|
1
|
0
|
1388
|
|
POST
|
Good work digging that post up, I always forget that arcpy has a decent PDF toolkit inside. Unfortunately, as I was tidying up the code it looks like it's unfinished. My assumption is the author wanted to grab the next odd page of the map series, index into the matching even page to get the geometry of the index and set the second frame to that extent. Here's what that looks like when finished: # Purpose: This script is designed to show 2 pages from a Map Series on
# one Layout. The first map frame runs through the odd numbered
# pages in the series, while the second frame runs through the even
# numbered pages.It then combines all pages into a single, multipage PDF.
import arcpy, os
#Filepath variables are machine specific. May need to change to execute sample
output_folder = r"C:\Path\To\Folder"
pdf_file_name = "InsertNameHere.pdf"
pdf_path = os.path.join(output_folder, pdf_file_name)
#Reference the current project, MUST be run in the ArcGIS Pro application
p = arcpy.mp.ArcGISProject("current")
#Reference the appropriate Map frames, Maps, Layers, and Layout
m = p.listMaps("All")[0]
lyt = p.listLayouts("Combo Layout")[0]
df1 = lyt.listElements("MAPFRAME_ELEMENT", "Left Frame")[0]
df2 = lyt.listElements("MAPFRAME_ELEMENT", "Right Frame")[0]
lyr = m.listLayers("index")[0]
# Lookup of index extents and page numbers
features = {row[0]: row[1:] for row in arcpy.da.SearchCursor(lyr, ["idx", "page_count", "SHAPE@"])}
# Get map series
ms = lyt.mapSeries
if not ms.enabled:
arcpy.AddError("Cannot export layout without an active map series.")
raise SystemExit(1)
#Create a new PDF that pages will be added into
#First remove the file if it already exists
if os.path.exists(pdf_path):
os.remove(pdf_path)
pdf = arcpy.mp.PDFDocumentCreate(pdf_path)
# Iterate odd pages, set matching map frame to matching even page, export and append
for page_num in range(1, ms.pageCount, 2):
ms.currentPageNumber = page_num
if page_num in features: # Assume page_num is always idx + 1
next_count, next_shp = features[page_num]
df2.camera.setExtent(next_shp.extent)
else:
df2.camera.setExtent(df1.camera.getExtent())
page_name = os.path.join(output_folder, f"{page_num}.pdf")
lyt.exportToPDF(page_name)
pdf.appendPages(page_name)
os.remove(page_name)
pdf.saveAndClose() This runs into issues if you want to add page numbers but the output I've attached is a good first start. Certainly easier than learning another Python library.
... View more
01-16-2025
10:26 AM
|
0
|
0
|
3087
|
|
POST
|
Ah, this is the product you're looking at. Seems like you would combine these instructions for adding an API with whatever components of the ArcGIS REST API you need to manage your data. Not an easy task by any means but a very plausible goal.
... View more
01-16-2025
08:43 AM
|
0
|
0
|
1195
|
|
POST
|
I don't think this is something you can do with an out-of-the-box map series, but if you're willing to use Python I can think of one possible way: Add the "pypdf" package to your Python environment. Generate the index layer for the full length. Create one map with the index layer and everything else you need. Set a definition query on the index that's MOD(page_count_field, 2) = 0 to only show the odd pages. Make a layout for this map with all of the required elements. Leave room for the other map and any other layout elements that is specific to the other map. You'll probably have to fudge the page numbers in your index layer as well. Clone the map and change the definition query from = 1 to = 0, this will only show the even pages. Create a complementary layout for the "even" map. Generate map series for both. Half the pages should be on the "odd" layout and the other half on the "even" layout. Export both PDFs, then use pypdf to merge each "even" page on top of the "odd" page to create a new PDF. The pypdf documentation is a bit sparse but it should cover all the methods uses to combine PDFs like this. Unfortunately I don't have time to validate this workflow, but the hard part with pypdf is similar to a process I've done with other projects so I'm confident you'll get something, even if it looks a bit cruddy. Let us know how it goes!
... View more
01-15-2025
03:49 PM
|
0
|
2
|
3133
|
|
POST
|
What is "API Manager" and what level of decoupling are you looking for? In general, any tool or service that supports HTTPS and OAuth2 can connect to an Enterprise deployment and route its own commands to the appropriate portal and server resources. This page is a good starting point.
... View more
01-15-2025
10:04 AM
|
0
|
0
|
1241
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | Friday | |
| 1 | a week ago | |
| 1 | 05-24-2023 11:47 AM | |
| 2 | 04-09-2026 11:36 AM | |
| 1 | 09-08-2023 10:07 AM |
| Online Status |
Online
|
| Date Last Visited |
a minute ago
|