POST
|
Scratch that... im done wasting my time on this method, using an obviously broken tool from ESRI. I will build a work around. If anyone else has had this issue though i would love to hear how and if you resolved it.
... View more
04-14-2020
05:30 PM
|
0
|
0
|
501
|
POST
|
Saving the rasters to the disk had the same result. No error, ran far too quickly, no fields or values in those fields added. I guess i may as well save the point feature class to the disk too and see if that changes the result...
... View more
04-14-2020
05:25 PM
|
0
|
0
|
501
|
POST
|
Does this tool only take rasters that are saved to disk? I suppose i will do that and see if it works...
... View more
04-14-2020
04:47 PM
|
0
|
0
|
501
|
POST
|
I have a point feature class, stored in memory, i have 5 rasters, stored in memory. I can extract the values of each individual raster with the point feature class using the ExtractValuesToPoints function with no problems. However, when i try and run ExtractMultiValuesToPoints, it runs VERY quickly (like 10 seconds) and returns a feature class that contains no new fields and no new values extracted from the raster, no errors are raised, nothing. I have tried defining the field name for each raster and passing that in the list with the rasters. I have tried not passing a field name. I have tried passing the raster result objects. I have tried passing the "in_memory" text path of the rasters. Same result no matter what i try. Has anyone else experienced this, i can find nothing on this or any other forum. Thanks.
... View more
04-14-2020
04:34 PM
|
0
|
3
|
543
|
POST
|
So, i have a python function defined that projects coordinates using the 'projectAs()' point geometry function. When i call this function in a script from a toolbox it gives different results vs calling it in a python command prompt window. See below python function below: def ProjectCoordinates(x,y,inputcrs,outputcrs):
import arcpy
point = arcpy.PointGeometry(arcpy.Point(x,y),inputcrs)
projectedpoint = point.projectAs(outputcrs)
projectedcoordinates = [projectedpoint.firstPoint.X,projectedpoint.firstPoint.Y]
return projectedcoordinates Full Toolbox Script: def ProjectCoordinates(x,y,inputcrs,outputcrs):
import arcpy
point = arcpy.PointGeometry(arcpy.Point(x,y),inputcrs)
projectedpoint = point.projectAs(outputcrs)
projectedcoordinates = [projectedpoint.firstPoint.X,projectedpoint.firstPoint.Y]
return projectedcoordinates
import arcpy
xin = arcpy.GetParameterAsText(0)
yin = arcpy.GetParameterAsText(1)
srin = arcpy.GetParameter(2)
srout = arcpy.GetParameter(3)
xout,yout = ProjectCoordinates(xin,yin,srin,srout)
arcpy.AddMessage(srin.name)
arcpy.AddMessage(srout.name)
arcpy.AddMessage(str(xout) + " ," + str(yout))
Results of Each: Can anyone replicate this? Does anyone have any ideas why this is happening? Also, if it helps, I know from surveyed data that the toolbox script output is correct and the command prompt output is incorrect.
... View more
07-03-2019
09:41 AM
|
0
|
5
|
3385
|
POST
|
The error it was returning is in the title of my post. "RuntimeError: start edit session". I solved the problem myself. Was running this script via a Toolbox in ArcGIS Pro and the layers were marked as editable in the contents. This prevent the script from updating the feature class. However, just an FYI, having the box checked next to a layer in ArcGIS Pro in the 'List by Editing' tab of the 'Contents' does not cause '.isEditing' to return 'True' but it does prevent an update cursor from updating a feature and prevents starting and stopping edit sessions from working properly.
... View more
05-16-2019
02:33 PM
|
3
|
0
|
2768
|
POST
|
For some reason when i try and start and stop an edit session the stop.Editing(True) does not work because it appears that an edit session was never started. See code snippet below: workspace = os.path.dirname(shl_fc)
edit = arcpy.da.Editor(workspace)
edit.startEditing()
arcpy.AddMessage(isEditing)
edit.startOperation()
# Update SHL Geometry
with arcpy.da.UpdateCursor(shl_fc,[shl_dsu_field_name,shl_well_num_field_name,'SHAPE@XY']) as shl_updatecursor:
for feature in shl_updatecursor:
if dsu_name in feature[0] and well_num in feature[1]:
projected_shl_coordinates = ProjectCoordinates(float(shl_coordinates[0]),float(shl_coordinates[1]),shl_coords_spatial_ref,shl_fc_spatial_ref)
newrow = []
newrow.append(feature[0])
newrow.append(feature[1])
newrow.append(projected_shl_coordinates)
shl_updatecursor.updateRow(newrow)
edit.stopOperation()
edit.stopEditing(True) Update: I added an 'AddMessage' statement to return the boolean value of '.isEditing' and it returns True. Update 2: Adding the 'isEditing' before the '.startEditing' returns False.
... View more
05-15-2019
01:20 PM
|
0
|
3
|
3414
|
POST
|
I don't normally have ArcMap open when i run this script. So that wouldn't make sense for my case.
... View more
05-03-2019
11:56 AM
|
0
|
0
|
1735
|
POST
|
Oops, it actually is outside of it in the actual program. That was just an error when i copied and pasted i guess.
... View more
05-03-2019
11:55 AM
|
0
|
0
|
1735
|
POST
|
So, I have a script that calculates polylines for well borepaths from CSV directional survey files and then updates the geometry of existing features with that calculated polyline; it also writes a "Y" to a attribute field called "REBUILT" so i know which features have the new updated calculated polyline. I have ran this script at least a dozen times without error. The last time i ran it, it completed with no errors reported, however the geometry was not updated for any of the features BUT the "REBUILT" field was created and written to. To put it simply, the update cursor is updating normal attribute fields but not geometry. Has anyone ran into something like this before? I would post the code here but it is hundreds of lines and is being run on proprietary data that i cannot share. The snippet below is the bit of the script where the Update Cursor is called: edit = arcpy.da.Editor(workspace)
edit.startEditing()
edit.startOperation()
with arcpy.da.UpdateCursor(clean_borepath_shapefile,["API_Text","REBUILT","SHAPE@"]) as borepath_cursor:
polylinecount = 0
for borepath in borepath_cursor:
api = borepath[0]
for county,coordinatesdict in countycoordinatesdict.iteritems():
if api in coordinatesdict:
coordinates = coordinatesdict.get(api)
if len(coordinates) > 0:
polyline = CreatePolyline(coordinates,spatial_reference)
borepath[1] = "Y"
borepath[2] = polyline
borepath_cursor.updateRow(borepath)
polylinecount = polylinecount + 1
edit.stopOperation()
edit.stopEditing(True) UPDATE: Just ran it again for the 5th or 6th time and it worked. The inputs didn't change, the code didn't change. Utterly baffled.
... View more
05-01-2019
01:30 PM
|
0
|
5
|
2169
|
POST
|
Yeah, it runs when I call the function in python essentially in a near identical fashion as you did above. However, using the GUI with the same inputs still yields no new table. Very odd. Im running version 10.6.1.9270.
... View more
01-15-2019
03:13 PM
|
0
|
1
|
928
|
POST
|
My script is working fine now. I wrote something to clean up the csv (remove commas from numbers, etc) and then included more arguments when adding fields to my created table (precision, etc) and that did the trick. However, the GUI toolbox 'table to table' tool on the same cleaned up csv exporting to the same geodatabase is not creating any output. So, at this point it doesn't really matter to me all that much but people I work with I'm sure would like to be able to use that tool. So if anyone has any insight on that I would be interested to hear it.
... View more
01-15-2019
02:16 PM
|
0
|
0
|
928
|
POST
|
I just wrote out what I had written in the console into a python scripts and ran it separately and it worked. Still, 'table to table' does not work for that sample of data i just pasted in my earlier reply .
... View more
01-15-2019
12:55 PM
|
0
|
2
|
928
|
POST
|
here is some sample data that i cannot get to create a table either... just drop into notepad or something and save as csv. API,Oil_EUR_MBBL,Gas_EUR_MMcf 5652846240000,0.000,30.670 5897751350000,0.251,370.725 5984332480000,0.390,1021.573
... View more
01-15-2019
12:41 PM
|
0
|
6
|
928
|
POST
|
It is all proprietary, just that bit I showed that was printing is probably too much. I am just confused as to why no errors are being reported but nothing is happening on the output side for two tools and my script.
... View more
01-15-2019
09:06 AM
|
0
|
8
|
928
|
Title | Kudos | Posted |
---|---|---|
3 | 05-16-2019 02:33 PM | |
1 | 12-05-2016 11:10 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|