IDEA
|
One of the last things I truly can't stand about Pro... Please add (bring back) the Cancel button!
... View more
a week ago
|
0
|
0
|
42
|
POST
|
Francis - In it's current state it will only work with planar coordinate systems (State Plane, UTM, etc.). Another way to do what you need is to use the "Raster To Point" tool and just add/calc a Lat and Long field to the table. Since geometry is produced (in addition to tabular records) this method would take longer, but should yield you your necessary outcome. Chris
... View more
10-28-2019
09:33 AM
|
0
|
1
|
1673
|
IDEA
|
Conspiracy theory: ESRI is withholding Python AddIns in Pro to maximize Professional Services/Business Partner profits associated with the ArcGIS Desktop to ArcGIS Pro conver$ion. Prove me wrong.
... View more
07-02-2019
09:18 AM
|
2
|
0
|
1100
|
IDEA
|
In Desktop, the arcpy.GetMessages() function generally returned full and useful geoprocessing tool information. However, in Pro (currently at 2.3.3) GetMessages() now generally only returns start/end/elapsed time (!?!?!). ESRI: Please bring back the full geoprocessing message! Many of us record extensive log files for the purposes of debugging and performance monitoring and testing. The messages retuned in Pro now don't even have the tool name any more! As a GIS Programmer/Analyst with 20+ years experience in geoprocessing automation, I find this pretty disappointing. In Desktop (v10.7 and before) >>> arcpy.Select_analysis(blah, blah) >>> arcpy.GetMessages() Executing: Select E:\lidar_derivatives\processing_data\rs_hydro_processing\fishnet.shp E:\lidar_derivatives\processing_data\rs_hydro_processing\tile_479\tile_479.gdb\tile_479 "TILE_ID = 479" Start Time: Sat May 18 09:38:56 2019 Succeeded at Sat May 18 09:38:58 2019 (Elapsed Time: 1.47 seconds) But now in Pro: >>> arcpy.Select_analysis(blah, blah) >>> arcpy.GetMessages() Start Time: Friday, May 24, 2019 2:35:35 PM Succeeded at Friday, May 24, 2019 2:35:37 PM (Elapsed Time: 1.47 seconds)
... View more
05-28-2019
10:10 AM
|
36
|
7
|
3741
|
POST
|
From the looks of it, it seems you are just clipping 4 layers with a user defined polygon geometry and then inspecting the outputs... I think it would be much more efficient to use the Intersect tool to perform the goeprocessing here as opposed to 4, ideally simultaneous (but elusive) clips. Then you would scan the output using a searchcursor for the presence of the constituent records of the 4 inputs. Using the Intersect tool's join_attributes='ONLY_FID' parameter will probably make this more efficient if you just care about a yes/no presence. The right tool for the right job.
... View more
03-19-2019
02:32 PM
|
0
|
0
|
1455
|
POST
|
GenerateNearTable tool would be faster than a SelectByLocation in a for loop. ... then probably just SummaryStatistics based on the BUILDING_ID as the case field (mean value of the other featureclass) No programming required!
... View more
03-19-2019
02:17 PM
|
1
|
0
|
666
|
POST
|
Thanks Dan, but I mean more in the context of a log file for a geoprocessing script. Tool name, parameters, etc... Basically I used to get this in Desktop: Mon Mar 04 18:00:44 2019 - Starting run of script file: \\dnr\divisions\FR_DATA\forest_info_2\gis\projects\synthetic_streams_westside\scripts\step_11_implement_stream_model_worker_v1061.py Mon Mar 04 18:00:44 2019 - Recording logfile to: D:\csny490\lidar_derivatives\step_11_implement_stream_model_worker_v1061_tile_4179_20190304180044.log Mon Mar 04 18:00:44 2019 - TEMP directory set to D:\csny490\lidar_derivatives\processing_data\rs_hydro_processing\tile_4179 Mon Mar 04 18:00:44 2019 - Checked out Spatial Analyst License Mon Mar 04 18:00:44 2019 - Checked out 3D Analyst License Mon Mar 04 18:00:51 2019 - Executing: CreateFileGDB D:\csny490\lidar_derivatives\processing_data\rs_hydro_processing\tile_4179 tile_4179 CURRENT Start Time: Mon Mar 4 18:00:51 2019 Succeeded at Mon Mar 4 18:00:51 2019 (Elapsed Time: 0.51 seconds) Mon Mar 04 18:00:52 2019 - Executing: Select D:\csny490\lidar_derivatives\processing_data\rs_hydro_processing\fishnet.shp D:\csny490\lidar_derivatives\processing_data\rs_hydro_processing\tile_4179\tile_4179.gdb\tile_4179 "TILE_ID = 4179" Start Time: Mon Mar 4 18:00:51 2019 Succeeded at Mon Mar 4 18:00:52 2019 (Elapsed Time: 0.76 seconds) Mon Mar 04 18:01:01 2019 - Con took 7.84943149986 seconds... Mon Mar 04 18:01:03 2019 - Executing: CopyFeatures D:\csny490\lidar_derivatives\sl_trans.gdb\sl_trans D:\csny490\lidar_derivatives\processing_data\rs_hydro_processing\tile_4179\tile_4179.gdb\sl_trans # 0 0 0 Start Time: Mon Mar 4 18:01:02 2019 Succeeded at Mon Mar 4 18:01:03 2019 (Elapsed Time: 1.31 seconds) Mon Mar 04 18:01:03 2019 - Executing: CalculateField fl ROAD_USGS_CLASS_CD 9 PYTHON # Start Time: Mon Mar 4 18:01:03 2019 Succeeded at Mon Mar 4 18:01:03 2019 (Elapsed Time: 0.02 seconds) Mon Mar 04 18:01:11 2019 - Executing: SelectLayerByLocation fl INTERSECT in_memory\f07C41C46_821F_403E_B860_78A1103462AD # NEW_SELECTION NOT_INVERT Start Time: Mon Mar 4 18:01:11 2019 Succeeded at Mon Mar 4 18:01:11 2019 (Elapsed Time: 0.12 seconds) Mon Mar 04 18:01:11 2019 - Executing: AddField D:\csny490\lidar_derivatives\processing_data\rs_hydro_processing\tile_4179\tile_4179.gdb\sl_trans BUFF_DIST SHORT # # # # NULLABLE NON_REQUIRED # Start Time: Mon Mar 4 18:01:11 2019 Adding BUFF_DIST to D:\csny490\lidar_derivatives\processing_data\rs_hydro_processing\tile_4179\tile_4179.gdb\sl_trans... Succeeded at Mon Mar 4 18:01:11 2019 (Elapsed Time: 0.09 seconds) Mon Mar 04 18:01:12 2019 - Executing: AddField D:\csny490\lidar_derivatives\processing_data\rs_hydro_processing\tile_4179\tile_4179.gdb\sl_trans RASTER_VAL SHORT # # # # NULLABLE NON_REQUIRED # Start Time: Mon Mar 4 18:01:12 2019 Adding RASTER_VAL to D:\csny490\lidar_derivatives\processing_data\rs_hydro_processing\tile_4179\tile_4179.gdb\sl_trans... Succeeded at Mon Mar 4 18:01:12 2019 (Elapsed Time: 0.12 seconds) but now I just get.... Wed Mar 13 11:41:29 2019 - Starting run of script file: \\dnr\divisions\FR_DATA\forest_info_2\gis\projects\synthetic_streams_westside\scripts\step_11_implement_stream_model_worker_vpro231.py Wed Mar 13 11:41:29 2019 - Recording logfile to: D:\csny490\lidar_derivatives\step_11_implement_stream_model_worker_vpro231_tile_4179_20190313114129.log Wed Mar 13 11:41:29 2019 - TEMP directory set to D:\csny490\lidar_derivatives\processing_data\rs_hydro_processing\tile_4179 Wed Mar 13 11:41:29 2019 - Checked out Spatial Analyst License Wed Mar 13 11:41:29 2019 - Checked out 3D Analyst License Wed Mar 13 11:41:30 2019 - Start Time: Wednesday, March 13, 2019 11:41:30 AM Succeeded at Wednesday, March 13, 2019 11:41:30 AM (Elapsed Time: 0.52 seconds) Wed Mar 13 11:41:31 2019 - Start Time: Wednesday, March 13, 2019 11:41:30 AM Succeeded at Wednesday, March 13, 2019 11:41:31 AM (Elapsed Time: 0.73 seconds) Wed Mar 13 11:41:32 2019 - Start Time: Wednesday, March 13, 2019 11:41:31 AM Succeeded at Wednesday, March 13, 2019 11:41:32 AM (Elapsed Time: 0.63 seconds) Wed Mar 13 11:41:41 2019 - Con took 8.238934079187088 seconds... Wed Mar 13 11:41:43 2019 - Start Time: Wednesday, March 13, 2019 11:41:41 AM Succeeded at Wednesday, March 13, 2019 11:41:43 AM (Elapsed Time: 1.19 seconds) Wed Mar 13 11:41:43 2019 - Start Time: Wednesday, March 13, 2019 11:41:43 AM Succeeded at Wednesday, March 13, 2019 11:41:43 AM (Elapsed Time: 0.17 seconds) Wed Mar 13 11:41:53 2019 - Start Time: Wednesday, March 13, 2019 11:41:51 AM Succeeded at Wednesday, March 13, 2019 11:41:51 AM (Elapsed Time: 0.12 seconds) Wed Mar 13 11:41:54 2019 - Start Time: Wednesday, March 13, 2019 11:41:53 AM Adding BUFF_DIST to sl_trans... Succeeded at Wednesday, March 13, 2019 11:41:54 AM (Elapsed Time: 0.43 seconds) Wed Mar 13 11:41:55 2019 - Start Time: Wednesday, March 13, 2019 11:41:54 AM Adding RASTER_VAL to sl_trans... Succeeded at Wednesday, March 13, 2019 11:41:55 AM (Elapsed Time: 0.44 seconds) Sad!
... View more
03-13-2019
01:47 PM
|
1
|
1
|
516
|
POST
|
Finally dabbling in porting some geoprocessing scripts to Pro. But... one of my 1st complainants is that arcpy.GetMessages() used to return pretty robust info in Desktop. For example, the buffer tool in Desktop would give something like: Executing: Buffer D:\csny490\lidar_derivatives\processing_data\rs_hydro_processing\tile_2\tile_2.gdb\sl_trans D:\csny490\lidar_derivatives\processing_data\rs_hydro_processing\tile_2\tile_2.gdb\sl_trans_buff BUFF_DIST FULL ROUND NONE # PLANAR Start Time: Wed Mar 6 09:20:33 2019 Succeeded at Wed Mar 6 09:20:43 2019 (Elapsed Time: 10.00 seconds) Now in Pro, it just yields: "Start Time: Wednesday, March 13, 2019 11:14:49 AM Succeeded at Wednesday, March 13, 2019 11:14:50 AM (Elapsed Time: 10.31 seconds)" Maybe there is some setting I am missing, or... Any insights?!?
... View more
03-13-2019
11:26 AM
|
2
|
3
|
1081
|
POST
|
Well that's good news... Yeah, I'm finding that some of the arcpy.mapping functions aren't the fastest horses on the track. Onwards and upwards!
... View more
02-08-2018
09:25 AM
|
0
|
0
|
860
|
POST
|
Why is there a need to write data to the in_memory tables? Seems like the stats you are calculating only rely on read data. Perhaps a dictionary could serve the purpose of you intermediate in_memory tables? Significant bottlenecks I see are: 1. Creating the intermediate tables, adding fields to them, and inserting values 2. Writing data to numpy arrays from the cursors. Seems like the np.square() calculations are entirely doable outside of numpy. Certainly more convenient in np though. 3. Using arcpy.mapping to get a hook into the layer. Maybe you could just have a toolbox w/ an input feature layer variable that had a default value set to your desired layer name?
... View more
02-07-2018
04:27 PM
|
0
|
3
|
860
|
POST
|
Note sure what the issue is - maybe just monkey with the values. For example in the interactive window try inserting some values like: updateRows.updateRow(("monkey", 1 , datetime.date(2017,2,5))) and see if they take. I know with the da cursors that dates are converted on the fly to Python datetime objects. If you interrogate the values in the dictionary are they all of the anticipated data type and order?
... View more
02-05-2018
03:39 PM
|
0
|
1
|
780
|
POST
|
I assume the fields are added to the mainTbl and dictionary gets populated with the correct values, right? I don't see anything in the update cursor, but... Are the "PIN_ID" and "PIN_Num" field types the same ("123" vs 123 vs 123.0)
... View more
02-05-2018
02:18 PM
|
0
|
5
|
780
|
POST
|
Here's a general example of dictionary/cursor method. Could certainly be made more elegant depending on what you are trying to do.... import arcpy mainTbl = r"C:\temp\blah.shp" joinTbl = r"C:\temp\lookup.dbf" fieldsToJoinList = ["FIELD1","FIELD2","FIELD3"] joinField = "COMMON_ID" arcpy.AddField_management(mainTbl, "FIELD1", "BLAH") arcpy.AddField_management(mainTbl, "FIELD2", "BLAH") arcpy.AddField_management(mainTbl, "FIELD3", "BLAH") joinTblDict = {r[0]:r[1:] for r in arcpy.da.SearchCursor(joinTbl, [joinField]+fieldsToJoinList)} updateRows = arcpy.da.UpdateCursor(mainTbl, [joinField]+fieldsToJoinList) for updateRow in updateRows: if updateRow[0] in joinTblDict: updateRow[1] = joinTblDict[updateRow[0]][1] updateRow[2] = joinTblDict[updateRow[0]][2] updateRow[3] = joinTblDict[updateRow[0]][3] updateRows.updateRow(updateRow) del updateRow, updateRows
... View more
02-05-2018
09:49 AM
|
0
|
7
|
888
|
POST
|
Use a dictionary and update cursor (which will be much faster than the classic join/calc or join/export)
... View more
02-02-2018
05:03 PM
|
0
|
1
|
888
|
Title | Kudos | Posted |
---|---|---|
1 | 02-13-2012 09:06 AM | |
2 | 10-05-2010 07:50 PM | |
1 | 02-08-2012 03:09 PM | |
1 | 10-31-2013 02:18 PM | |
1 | 06-20-2011 07:53 AM |
Online Status |
Offline
|
Date Last Visited |
a week ago
|