|
POST
|
It's not during consolidation, it's during validation because it's evaluating the URL as a data source registered with the data store or not. And since the data store does not register valid REST endpoints but only direct DB connections, this will raise an error and advise to copy the data to the server (a silly circular reference). That said, the faking the string as you suggested is intriguing and I will try that to see if it sneaks by the validation. It's odd that this isn't accounted for since Python web API would happily use a feature service URL even in a federated environment and you could share (and possibly publish, I've not tried) that notebook but for a script tool you cannot. Obviously the script tool works just fine while using Pro (it's not necessary to add the layers to your session but only that Pro is logged into Portal). I can flip this to direct GDB connections but it will be so so slow (remote DB in the cloud) for the initial run of the script tool just so that I can capture the result and use that to publish the GP Service.
... View more
04-07-2022
05:18 PM
|
0
|
0
|
4695
|
|
POST
|
I'm simply referencing them to the Feature Service REST endpoints like so: inFeatures = "https://myserver.mydomain.com/server/rest/services/Folder/FeatureServiceName/FeatureServer/1"
... View more
04-07-2022
09:19 AM
|
0
|
3
|
4719
|
|
POST
|
I've developed a script tool which I'm looking to publish as a GP service. The script leverages several feature service URLs from our Enterprise system hard-coded inputs for the script; using direct DB connections to the under lying database isn't a viable option. Obviously, you cannot/do not register server URLs with your Data Store, but since the validation process cannot find these resources in the Data Store, it warns that the data source is not registered and will therefore be copied. inFeatures = "https://myserver.mydomain.com/server/rest/services/Folder/FeatureServiceName/FeatureServer/1" I thought that maybe I could simply parameterize these URLs in the Script Tool but I'm not sure that you can make these hidden or locked. Is there anyway to go about publishing this without using a direct DB connection? EDIT: I'm suddenly remembering something about registering a folder that contains a valid AGS connection file...hmmm UPDATE: No dice. I saved a server connection file (.ags) to a folder registered with the data store, but I've am not able to use this input in any code. For example, making a feature layer from the REST endpoint for the layer within the feature service using the .ags file: testLayer = arcpy.management.MakeFeatureLayer("\\\\sharedLocation\\Folder\\AGSConnections\\connectionFile.ags\\serverFolder\\featureService.FeatureServer\\layer","test") [Note this is the format used if you drag the layer from ags connection file in the catalog pane to the Python window in Pro.]
... View more
04-07-2022
08:28 AM
|
0
|
12
|
5828
|
|
POST
|
I've developed a script tool which I'm looking to publish as a GP service. The script leverages several feature service URLs from our Enterprise system hard-coded inputs for the script; using direct DB connections to the under lying database isn't a viable option. Obviously, you cannot/do not register server URLs with your Data Store, but since the validation process cannot find these resources in the Data Store, it warns that the data source is not registered and will therefore be copied. I thought that maybe I could simply parameterize these URLs in the Script Tool but I'm not sure that you can make these hidden or locked. Is there anyway to go about publishing this without using a direct DB connection?
... View more
03-28-2022
11:11 AM
|
0
|
3
|
884
|
|
IDEA
|
How is it possible this hasn't been implemented yet?! Am i going to have to install ArcMap just so I can make schema changes between replicas!? We're approaching a version 3.0 of Pro and the fact this kind of GDB maintenance hasn't been implemented yet makes me extremely wary of the direction Esri is going in. Similar to the lack of support for Database Servers (Workgroup & Desktop on SQL Express). I can't help but think that Esri is walking away from this technology and it would sure be great to have at least some foresight into this.
... View more
03-10-2022
10:58 AM
|
0
|
0
|
5240
|
|
IDEA
|
We have a high demand to supply a shape export in the field to contractors. Situation is generally a disconnected environment. Transfer is completed with a BT option such as AirDrop. Markups are wholly inadequate with their simplicity; field workers should be able to share data they have collected. Receivers/contractors are not members of our ArcGIS organization so: they are likely leveraging a 3rd party solution which can consume shapefiles they are unlicensed within our organization a synchronization process to & from our Enterprise environment is unfeasible for them. Esri Take Note Here!!!: Avenza maps supports this functionality and it is widely used. If you were support this with Field Maps, you would deal a significant blow to that solution and make Field Maps that much stronger of an option.
... View more
02-11-2022
07:08 AM
|
12
|
1
|
2662
|
|
POST
|
@JoshuaBixby @CMV_Erik Sorry for the lag in response here, we've been swamped with project work so dev efforts get shelved. @JoshuaBixby wrote: The reason the numbering isn't resetting is that the numbering is starting at 1 and going until the end for all records each time you call SpatialRenumberPoints. That is the exact insight I needed. To be real honest, I'm pretty sure my lack of this comprehension has confounded other things in the past too. I tried Erik's solution but it didn't work for, I presume, the exact reason you point out. My challenge is that I want to keep this function stand alone to be used in other scripts, so I'll try to make an option argument like 'GroupField=None' or something. Nope that's a dead end...doh! UPDATE: Here are Josh's suggestions integrated and the code is now working! with arcpy.da.SearchCursor('PlotCopy',['CLUSTER_ID'],sql_clause=(None, "GROUP BY CLUSTER_ID")) as cur:
for row in cur:
SpatialRenumberPoints('PlotCopy',1,'CLUSTER_ID',row[0])
print("Updating {0}...".format(row[0])) which calls up the function: def SpatialRenumberPoints(InLayer, StartNumber, GroupField=None, GroupID=None):
arcpy.management.AddXY(InLayer)##Could verify if exists first##
arcpy.AddField_management(InLayer, "NewID", 'LONG')##Could verify if exists first##
fields = ['OID@','POINT_X','POINT_Y','NewID']
if GroupField is None:
WhereClause = None
else:
WhereClause =""" "{0}" = '{1}' """.format(GroupField, GroupID)
print(WhereClause)
sqlOrder = "ORDER BY {0} DESC, {1} ASC".format(fields[2], fields[1])
with arcpy.da.UpdateCursor(InLayer, fields, where_clause = WhereClause, sql_clause = (None, sqlOrder)) as cursor:
for row in cursor:
row[3]= StartNumber
StartNumber = StartNumber + 1
cursor.updateRow(row)
del cursor, row @JoshuaBixby I'm guessing this looks pretty crude to you, any suggestions for improvements? Also, is the Group By in the Search Cursor even needed now? Thanks for any additional insight!
... View more
02-03-2022
05:51 AM
|
0
|
0
|
2837
|
|
POST
|
I clicked too soon. Declaring the variable within the function did not fix the issue. I think I need to consider something like what @JoshuaBixby suggested.
... View more
02-03-2022
05:45 AM
|
0
|
2
|
2837
|
|
POST
|
To be fair, I don't know if this actually qualifies as a 'nested cursor' but it is a cursor calling up a function which has a cursor in it. For starters, here is my function: it simply assigns a new identifier based on the points spatial location: def SpatialRenumberPoints(InLayer, StartNumber):
arcpy.management.AddXY(InLayer)##Could verify if exists first##
arcpy.AddField_management(InLayer, "NewID", 'LONG')##Could verify if exists first##
fields = ['OID@','POINT_X','POINT_Y','NewID']
sqlOrder = "ORDER BY {0} DESC, {1} ASC".format(fields[2], fields[1])
with arcpy.da.UpdateCursor(InLayer, fields,sql_clause = (None, sqlOrder)) as cursor:
for row in cursor:
row[3]= StartNumber
StartNumber = StartNumber + 1
cursor.updateRow(row)
del cursor, row When calling this function up in the Python Window, the next time it was run, the function would continue where it's last highest value left off. This was fixed by deleting out the cursor at the end of the function. Life is/was good. Now, I realized I had a use case where I wanted to run the same tool against a dataset which has groups of points (identified by an attribute) and iterate through each group. No problem I thought, I'll just use use 'GROUP BY' for the SQL Clause in a search cursor. Like so: with arcpy.da.SearchCursor('PlotCopy',['CLUSTER_ID'],sql_clause=(None, "GROUP BY CLUSTER_ID")) as cur:
for row in cur:
SpatialRenumberPoints('PlotCopy',1)
print(row) The only problem is that here again, the cursor isn't resetting or starting from '1' for each iteration. Perhaps I'm using GROUP BY inappropriately and should use my search cursor to setup a selection instead? Thanks to anyone who can help!!
... View more
01-13-2022
11:52 AM
|
0
|
7
|
2954
|
|
POST
|
Thanks Aaron! so is there a JSON object for each form entry (user fills out a form; new JSON object is written) or is the JSON just acting as a configuration and the form is writing to the feature service attributes/records?I.e. Form-based data entry. If the latter, then I'm fine with that since these records can easily be extracted and would reside safely within the eGDB.
... View more
12-20-2021
12:50 PM
|
0
|
0
|
1513
|
|
POST
|
Hi there, We're currently using Field Maps as a replacement for Collector on Enterprise 10.7 and are about to make the jump to 10.9.1 which will have Field Maps native to the Enterprise environment. I'm currently (indeed have been for several years now) deciding between Survey123 vs Field Maps smart forms. Our primary use is regulatory compliance documentation. While discussing the complexity of the forms in deciding between the two options has merit (particularly in UI/UX), data storage is my primary concern. When a form is authored in Field Maps, it appears that it is an object associated with the 'map' itself. Where are these forms written to? Do they exist as objects within the data store? Can they be transferred to an ECM outside the Esri ecosystem? Thanks in advance!
... View more
12-20-2021
11:20 AM
|
0
|
4
|
1560
|
|
POST
|
Here's the code I'm currently using BTW. Autoincrement is just the sample from Esri docs: import arcpy
from AutoIncrement import AutoIncrement
def SpatialRenumberPoints(InLayer):
arcpy.management.AddXY(InLayer)
arcpy.AddField_management(InLayer, "NewID", 'LONG')
fields = ['OID@','POINT_X','POINT_Y','NewID']
sqlOrder = "ORDER BY {0} DESC, {1} ASC".format(fields[2], fields[1])
with arcpy.da.UpdateCursor(InLayer, fields,sql_clause = (None, sqlOrder)) as cursor:
for row in cursor:
row[3] = AutoIncrement()
cursor.updateRow(row)
... View more
10-27-2021
10:49 AM
|
0
|
0
|
1907
|
|
POST
|
I'm trying to create a simple function to sort based on a point FC X & Y values and then add a sequential ID. I know the 'old' update cursor supports sort fields directly, where arcpy.da.searchcursor you must use an SQL statement such as ORDER BY. I'm leaning towards using shape tokens since the input FC may or may not have an X & Y coordinate field. fields = ['OID@','SHAPE@X','SHAPE@Y','NewID']
sqlOrder = "ORDER BY {0}, {1} ASC".format(fields[1],fields[2])
startNumber = 100
with arcpy.da.UpdateCursor('Renum', fields,sql_clause = (None, sqlOrder) as cusor:
for row in cursor:
row[3] = startNumber + 1
cursor.updateRow(row) For which I'm getting: Traceback (most recent call last):
File "<string>", line 2, in <module>
RuntimeError: Bad syntax in request. (status code 400). The input FC is in a fGDB so SQL ORDER BY is supported (according to the documentation). I guess this is less so about evaluating this code as it is the question: do SQL statements accepts shape tokens? I guess my alternative is to simply add XY values and then have a known set of fields to work with.
... View more
10-27-2021
08:29 AM
|
0
|
3
|
1917
|
| 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
|