POST
|
I'm trying to publish a feature service on ArcGIS Server from ArcMap. The layer within the map is sourced from a feature class in a File Geodatabase that is part of a relationship class with another f-class in the same GDB. I keep getting an error code 00134 saying "Layer's data source is not supported". From what I've read regarding this code it sounds like only relationship classes within an enterprise database can be published to a feature service. Is this correct? If so, why? ArcGIS Desktop and Server v10.8.1
... View more
03-02-2022
11:31 AM
|
0
|
6
|
1641
|
BLOG
|
Hi Suzanne, I'm looking for some more information on how to publish relationship classes and their supporting data to an ArcGIS Server service from ArcMap. From what I've read the feature classes and tables would have to be in the same MXD, and published as a Feature Service. The problem I'm running into is that I'm using a File Based Geodatabase as opposed to an Enterprise Geodatabase. I keep getting a "Layer's data source is not supported" error. Are FBGDB relationship classes not compatible?
... View more
03-02-2022
08:33 AM
|
0
|
0
|
895
|
POST
|
I finally figured it out, and sharing the code in case anyone runs into a similar situation and needs some sample code to get them started import arcpy
# Local variables:
River_Section = "C:\<path to your GDB f-class>"
Adjacent_MileMarkers = "C:\<path to your GDB f-class>"
scursor = [row[0] for row in arcpy.da.SearchCursor(Adjacent_MileMarkers, ("MILE_TEXT"))]
print "List Comprehension value is: " + str(scursor)
i=0
ucursor = arcpy.da.UpdateCursor(River_Section, ["MILE_MARKERS"])
for row in ucursor:
row[0] = str('Mile Marker:' + scursor[i] + ' to Mile Marker:' + scursor[i+1])
print row[0]
ucursor.updateRow(row)
print "Script Complete"
... View more
02-11-2021
07:42 AM
|
1
|
0
|
423
|
BLOG
|
@RichardFairhurstI came across your blog while looking for a way to extract a couple of field values from a single field, and append them together (in a string) in another table/field within a single cell. From what I've been reading I need to use a dictionary to store the values from the SearchCursor, then UpdateCursor to populate the cell with the dictionary values. Does this sound correct? In my mind it seems so straightforward, but getting it to actually work is a different story. Any thoughts?
... View more
02-02-2021
11:40 AM
|
0
|
0
|
20103
|
POST
|
Jeff, I've now realized that I needed to switch out the InsertSursor with UpdateCursor because I'm trying to put the values into an existing feature's MILE_MARKERS value. Using your last code sample I made that change along with some other minor tweaks, and got the correct value to populate the cell "Value 1: 336 Value 2: 337". I had to switch from using the OBJECTID field to a MILE integer field in the table in order to capture the values in ascending order. This is so that the value shows a range in mile markers. So the code runs, but then throws an error: "previousMT = [x[1] for x in arcpy.da.SearchCursor(Adjacent_MileMarkers, ['MILE', 'MILE_TEXT'], wc)][0] IndexError: list index out of range" with arcpy.da.SearchCursor(Adjacent_MileMarkers, ['MILE', 'MILE_TEXT']) as S_cursor:
for row in S_cursor:
# Use your lowest ID here because that will be your floor
if row[0] != 1:
# Create your filter to get the previous value using the current Id - 1
wc = """MILE = {}""".format(row[0] - 1)
#wc = """OBJECTID = {}""".format(row[0] - 1)
# get the previous Mile_Text value by filtering the for Id -1
previousMT = [x[1] for x in arcpy.da.SearchCursor(Adjacent_MileMarkers, ['MILE', 'MILE_TEXT'], wc)][0]
resString = 'Value 1: {} Value 2: {}'.format(previousMT, row[1])
print "Initial resString is: " + (resString)
else:
# if the incoming selection is your floor, there will not be any previous 'MILE_TEXT'.
resString = 'Value 1: {}'.format(row[1])
print "else resString is: " + (resString)
# update target FC
with arcpy.da.UpdateCursor(River_Section, 'MILE_MARKERS') as U_cursor:
for row in U_cursor:
U_cursor.updateRow([resString]) I think I need to end it after one pass somehow.
... View more
02-01-2021
11:24 AM
|
0
|
1
|
445
|
POST
|
Thanks guys. That seemed to work. No errors now, and I'm getting data in the second table. However, it's producing two rows. The first row only has one value, the second looks correct with both values I also had to use brackets instead of parenthesis around reString with arcpy.da.InsertCursor(River_Section, "MILE_MARKERS") as iCursor: iCursor.insertRow([resString])
... View more
01-29-2021
02:42 PM
|
0
|
0
|
1248
|
POST
|
Yeah I noticed the need for quotes around the field name right before you responded. After inserting them, I now get a TypeError: sequence size must match size of the row when I run it. The field width that I'm inserting to is plenty large so I'm not sure what's causing it.
... View more
01-29-2021
02:28 PM
|
0
|
1
|
1256
|
POST
|
Sorry for that I'm not able to explain this very clearly Jeff. You're correct with how the table is structured. When I run the last code sample, I'm back to the syntax error with the second "as" in the script.
... View more
01-29-2021
02:13 PM
|
0
|
6
|
1265
|
POST
|
Correct. The data in the MILE_TEXT field would be 337 in the first cell, then 336 in the second cell. I'd like to grab these two values then insert them into a single cell within the MILE_MARKERS field within the River_Section table. So in theory I think there's no need for the split at all now that I look at it.
... View more
01-29-2021
01:34 PM
|
0
|
0
|
1287
|
POST
|
Thanks Jeff. I changed the code per your last suggestion. I'm still getting the "list index out of range". The print results only show one value, but I think it should show two. Which from I remember might be causing the index to be out of range in "reString"
... View more
01-29-2021
01:05 PM
|
0
|
2
|
1731
|
POST
|
Jeff, I setup two stand alone f-classes to emulate the selection results from within the model. I figured if I can get the script to function with those, then I can focus on embedding it within the model next. When I first started running the code I was getting an invalid syntax error within arcpy.da.InsertCursor(Table2, Field_B) as cur: I moved things around to appear like this: , but now I'm getting a "IndexError: list index out of range" error. Any ideas?
... View more
01-29-2021
12:22 PM
|
0
|
4
|
1736
|
POST
|
HI Joe. The values that I'm trying to take from Table1 are the results of a spatial query. In this case two separate values ("1234" and "5678") from two cells in the same field of the selected features. I'm trying to insert both of those values into a single cell within Table2 ("Value 1: 1234 to Value 2: 5678"). Table2 already exists and the target field is there. I hope this answers your questions. Thanks.
... View more
01-29-2021
12:00 PM
|
0
|
1
|
1741
|
POST
|
Thanks for the quick reply Jeff. I'll give this a shot and let you know how it turns out. Appreciate the help!
... View more
01-29-2021
09:46 AM
|
0
|
0
|
1745
|
POST
|
I'm building a geoprocessing model that iterates through features in one f-class and spatially selects features from another f-class that are within a certain distance of each feature. I want to pull values from one f-class to the other. The model essentially does a select features by location, and from that selection I would like to pull values within a single field, concatenate them together as a string and insert that value into the other f-class field in a single cell. I believe that I need to use some cursors within ArcPy to do this (SearchCursor & InsertCursor) and embed the Python script within the model, but I'm not entirely sure. So basically Table1 FIELD_A has two values "1234" and "5678". I want to take those two values and insert them into a single cell within Table2 FIELD_B so that the value looks something like "Value 1: 1234 to Value 2: 5678". Any assistance would be appreciated.
... View more
01-28-2021
02:28 PM
|
0
|
22
|
3530
|
POST
|
I'm responding to myself in case anyone else has the same issue. I resolved the problem by turning off the firewall within my private network. I imagine I can get it to work by configuring the firewall to allow the connection, but for now I'm going with shutting it down. I'll report back if I go that route
... View more
09-22-2020
09:22 AM
|
0
|
0
|
4467
|
Title | Kudos | Posted |
---|---|---|
1 | 02-13-2024 08:34 AM | |
1 | 02-28-2024 11:51 AM | |
1 | 02-12-2024 12:55 PM | |
2 | 02-12-2024 12:43 PM | |
1 | 08-21-2020 01:00 PM |
Online Status |
Offline
|
Date Last Visited |
3 weeks ago
|