|
POST
|
i'm trying to create this portal to allow someone to audit field surveys. the auditor selects the survey to audit from the list, it then selects the audit feature which is related to the survey but as soon as they update a question on the table it disappears and you get this just a blank table
... View more
02-12-2025
02:49 AM
|
0
|
1
|
292
|
|
POST
|
thanks @DavidPike i changed the spatial reference when querying my layers and it works, even gives me the correct distance
... View more
01-10-2025
01:22 AM
|
2
|
0
|
227
|
|
POST
|
this is the geometry of one of the polylines {"geometry": {"paths": [[[-1.04626706475298, 52.5312679471987], ........ [-1.0447855316579, 52.5304270718345]]], "spatialReference": {"wkid": 4326, "latestWkid": 4326}} this is the geometry for one of the points {"geometry": {"x": -1.0453711186340822, "y": 52.53063399067387, "spatialReference": {"wkid": 4326, "latestWkid": 4326}} thanks for the help Stu
... View more
01-09-2025
06:36 AM
|
0
|
1
|
1434
|
|
POST
|
this is the code: for xbsg in bsgPoints:
print(xbsg.attributes["objectid"])
print(xbsg)
access_point = Point(xbsg.geometry)
access_res = access_polyline.query_point_and_distance(access_point)
if (access_res):
print(access_res)
print("--++--")
print(access_res[0].JSON)
print("----") this is the code's closest point but i was expecting this as the closest point: and this is the distances returned: i also found that post and it suggests that the distance is the second item so 0.001106969364200805
... View more
01-09-2025
06:03 AM
|
0
|
2
|
1437
|
|
POST
|
it also looks like its only getting the closest vertex rather than the closest point on the line unfortunately
... View more
01-09-2025
03:17 AM
|
0
|
1
|
1439
|
|
POST
|
thanks @DavidPike that was the issue it looks like its returning the distance now but it looks like its in radians?
... View more
01-09-2025
01:39 AM
|
0
|
0
|
1451
|
|
POST
|
so this sounds simple and if i use Near in Pro it is but i want to create a AGOL python notebook to run once a day to loop over any point features created that day and get the closest XY to a feature service of polylines (50k features) i tried following the example here Part 3 - Spatial operations on geometries | ArcGIS API for Python but even if i just manually populate the geomenty json for both the point and the polyline it returns None
... View more
01-08-2025
06:14 AM
|
1
|
10
|
1725
|
|
POST
|
this for some reason the feature layers are all now showing with a wkid and select by location now works... very odd Stu
... View more
11-18-2024
03:15 AM
|
0
|
0
|
648
|
|
POST
|
How can i add a spatial reference to a feature service? my feature service is not showing a spatial reference when querying the extent but if i check another feature service it shows one i think this is the cause of why my intersection or select by location in pro returns 0 results or just fails
... View more
11-15-2024
06:18 AM
|
0
|
2
|
711
|
|
POST
|
i change it to use the field calculator instead of the update cursor, it works but the downside is its significantly slower 😔 with arcpy.da.SearchCursor(fc, ["objectid", "FeatureID","Angle" ,"SHAPE@", "SHAPE@X", "SHAPE@Y","LEGACY_TABLE_NAME"],"objectid in (4011345,4011328,4011327,4011326,4011325,4011324,4011323,4011346)") as Cur:
for row in Cur:
# read in the data
print row[0]
SA_Filter = "OBJECTID = {0}".format(row[0])
print SA_Filter
try:
arcpy.management.SelectLayerByAttribute(fc, "NEW_SELECTION", SA_Filter)
annocount = arcpy.management.GetCount(fc)
print "tmp count: {0}".format(annocount[0])
if int(annocount[0]) == 1:
print "selected one anno"
arcpy.management.SelectLayerByLocation(fc, "INTERSECT", fc, "", "NEW_SELECTION")
tmpcount = arcpy.management.GetCount(fc)
print "tmp count: {0}".format(tmpcount[0])
if int(tmpcount[0]) >= 2 and int(tmpcount[0]) < 74:
print "more than 1"
arcpy.management.SelectLayerByAttribute(fc, "NEW_SELECTION", SA_Filter)
arcpy.CalculateField_management(fc, "Angle",
"!ANGLE!+90",
"PYTHON_9.3")
except Exception as e:
print "Error with message: {0}".format(e)
... View more
10-31-2024
03:48 AM
|
0
|
1
|
1538
|
|
POST
|
but oddly if i reconcile my session and refresh the map it has updated the first one i'm thinking the issue is the arcfm session side
... View more
10-31-2024
02:17 AM
|
0
|
0
|
1556
|
|
POST
|
Hi @BrandonMcAlister thanks i tried that and it still failed, i even recreated the data and re-ran it incase the data had been corupted with arcpy.da.SearchCursor(fc, ["objectid", "FeatureID","Angle" ,"SHAPE@", "SHAPE@X", "SHAPE@Y","LEGACY_TABLE_NAME"],"objectid in (4011345,4011328,4011327,4011326,4011325,4011324,4011323,4011346)") as Cur:
for row in Cur:
# read in the data
print row[0]
SA_Filter = "OBJECTID = {0}".format(row[0])
print SA_Filter
try:
arcpy.management.SelectLayerByAttribute(fc, "NEW_SELECTION", SA_Filter)
annocount = arcpy.management.GetCount(fc)
print "tmp count: {0}".format(annocount[0])
if int(annocount[0]) == 1:
print "selected one anno"
arcpy.management.SelectLayerByLocation(fc, "INTERSECT", fc, "", "NEW_SELECTION")
tmpcount = arcpy.management.GetCount(fc)
print "tmp count: {0}".format(tmpcount[0])
if int(tmpcount[0]) >= 2 and int(tmpcount[0]) < 74:
print "more than 1"
with arcpy.da.UpdateCursor(fc, ["objectid", "FeatureID","Angle" ,"SHAPE@", "SHAPE@X", "SHAPE@Y","LEGACY_TABLE_NAME"],"objectid = {0}".format(row[0])) as UPDCur:
for upd in UPDCur:
print "entered Update cursot"
upd[2] = float(upd[2]) + 90
upd[6] = "te22st"
UPDCur.updateRow(upd)
except Exception as e:
print "Error with message: {0}".format(e)
... View more
10-31-2024
02:13 AM
|
0
|
0
|
1556
|
|
POST
|
Hi @CodyPatterson this is what i get: i think the issue is with this line as it works in terms of selecting the features by their objectid and also the select by location part. Cur.updateRow(row) i'm running this in Desktop 10.2.1 on a versioned dataset. i'm very confident that it was working yesterday but today its being a pain... i've used similar update cursors and its worked but this time after the first feature it seems to loose connection with the database as the features disappear from the map and this pops up:
... View more
10-30-2024
09:54 AM
|
0
|
1
|
1592
|
|
POST
|
so this is to check if any annotation overlaps and if it does it rotates one by 90 degrees this just loops through the features and works fine with arcpy.da.UpdateCursor(fc, ["objectid", "FeatureID","Angle" ,"SHAPE@", "SHAPE@X", "SHAPE@Y","LEGACY_TABLE_NAME"],"objectid in (4007789,4007788,4007787,4007786,4007791,4007790)") as Cur:
for row in Cur:
# read in the data
print row[0]
SA_Filter = "OBJECTID = {0}".format(row[0])
try:
arcpy.management.SelectLayerByAttribute(fc, "NEW_SELECTION", SA_Filter)
annocount = arcpy.management.GetCount(fc)
print "tmp count: {0}".format(annocount[0])
if int(annocount[0]) == 1:
print "selected one anno"
arcpy.management.SelectLayerByLocation(fc, "INTERSECT", fc, "", "NEW_SELECTION")
tmpcount = arcpy.management.GetCount(fc)
print "tmp count: {0}".format(tmpcount[0])
if int(tmpcount[0]) >= 2 and int(tmpcount[0]) < 74:
print "more than 1"
row[2] = float(row[2]) + 90
except:
print "Error" but when i add in a simple update to a text field it fails with arcpy.da.UpdateCursor(fc, ["objectid", "FeatureID","Angle" ,"SHAPE@", "SHAPE@X", "SHAPE@Y","LEGACY_TABLE_NAME"],"objectid in (4007789,4007788,4007787,4007786,4007791,4007790)") as Cur:
for row in Cur:
# read in the data
print row[0]
SA_Filter = "OBJECTID = {0}".format(row[0])
try:
arcpy.management.SelectLayerByAttribute(fc, "NEW_SELECTION", SA_Filter)
annocount = arcpy.management.GetCount(fc)
print "tmp count: {0}".format(annocount[0])
if int(annocount[0]) == 1:
print "selected one anno"
arcpy.management.SelectLayerByLocation(fc, "INTERSECT", fc, "", "NEW_SELECTION")
tmpcount = arcpy.management.GetCount(fc)
print "tmp count: {0}".format(tmpcount[0])
if int(tmpcount[0]) >= 2 and int(tmpcount[0]) < 74:
print "more than 1"
row[2] = float(row[2]) + 90
row[6] = "updated"
Cur.updateRow(row)
except:
print "Error"
... View more
10-30-2024
08:20 AM
|
0
|
8
|
1627
|
|
POST
|
did you ever get this to work, i am having the same issue
... View more
10-25-2024
03:51 AM
|
0
|
0
|
720
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 09-08-2025 07:14 AM | |
| 8 | 07-17-2025 01:23 AM | |
| 3 | 07-04-2025 02:55 AM | |
| 1 | 06-27-2025 03:41 AM | |
| 1 | 06-27-2025 02:05 AM |
| Online Status |
Offline
|
| Date Last Visited |
Friday
|