POST
|
We are now struggling with the same question and we would solve it the same way, as you did, Fabian. I expected at least to be able to create a C#/.net-GP Tool to call it from python. I cannot understand, why this isn't supported in the Pro SDK. Also nice would be to enable ArcGIS Pro command search and execution from python script. It really does not make sense to call Python Script from C#/.net Code. Scripts are used to automate things, C#/.net to implement functions. I picked this up to hopefully draw other customers and esri's attention to it. Thanks for this post, Fabian and kind regards
... View more
05-11-2022
01:12 AM
|
3
|
0
|
1441
|
POST
|
You probably solved it already by yourself. In case not: Just remove the return statement and push the arcpy.RefreshActiveView() statement to the end of the script at the same inset level as the for loup.
... View more
07-23-2020
03:04 AM
|
0
|
0
|
892
|
POST
|
Could you explain why you would want to multiplicate potentially large B features to join attributes of A ? When joining this way you will end up with duplicated B geometries for every A with centroid in B and lost A geometry. What is the use case for such a requirement?
... View more
09-23-2019
06:25 AM
|
0
|
3
|
2784
|
POST
|
Regarding ERROR 999999: Did you try to run "Repair Geometry" before applying the buffer? This could also be necessary again after each buffer operation especially for inset buffers, since there are often a lot of intersects and multipart geometries.
... View more
10-23-2018
12:21 AM
|
1
|
5
|
2174
|
POST
|
You are right. It does not make sense, to store large raster datasets in geodatabases for raster processing, and we effectively do not. But we also process large vector dataset, and i used to work for a long time as a software engineer for ArcGIS network information systems in the utilities sector (where gas pipelines belong to). Neverthless the memory-problem with numpy arrays stays the same for raster and vector data, and an out-of-the-box solution for partitioning seems not to exist. By the way: Another difference with my solution is, that the database model of the original point feature class does not change (no fields added), which is often a requirement in a production environment.
... View more
09-12-2018
11:45 AM
|
1
|
0
|
703
|
POST
|
The search cursor is designed for large datasets in a relational database and loads data sequentally buffered. We do a lot of raster data processing with python/gdal/numpy (with 64bit-Python), and had to partition data by ourselves. Is there an other way? Do you know how to automatically process feature class data sequentally buffered with numpy arrays? That would be of great help. Your example just shows statical arrays, which would have to be populated in advance.
... View more
09-12-2018
07:02 AM
|
1
|
2
|
703
|
POST
|
The difference is, that it does not cache data in memory. Loading all data first into arrays is often not possible for big data. So you need sequential algorithms or geoprocessing tools to solve the problem. In addition it expands the original approach, which is probably better understood.
... View more
09-12-2018
04:26 AM
|
2
|
5
|
703
|
POST
|
It is probably not possible to solve the problem in a single iteration. I therefore suggest to save selected gisids in a table and join it to the layer to select the affected points. You could to the following based on your sequental approach without caching: (I didn't test it...) import arcpy
counter = 0
FirstMSDepth = -1
InspectMSDepth = -1
NextMSDepth = -1
FirstGisID = -1
InspectGisID = -1
NextGisID = -1
thresHold = 0.2
gisIDArray = []
with arcpy.da.SearchCursor('GPS Gas Main Pipe Point',[ 'GISID', 'SPAR_DEPTH'], sql_clauses='ORDER BY GISID') as cursor:
for row in cursor:
currRate = 0
if counter > 1:
currRate = abs(FirstMSDepth-InspectMSDepth)/InspectMSDepth
if currRate < thresHold and counter > 0:
currRate = abs(NextMSDepth-InspectMSDepth)/InspectMSDepth
if currRate >= thresHold:
print("GISID {} - Rate {}".format(InspectGisID, currRate)
gisIDArray += [InspectGisID]
FirstMSDepth, FirstGisID = InspectMSDepth, InspectGisID
InspectMSDepth, InspectGisID = NextMSDepth, NextGisID
NextMSDepth, NextGisID = row[1], row[0]
counter+= 1
if counter > 1:
currRate = abs(FirstMSDepth-InspectMSDepth)/InspectMSDepth
if currRate < thresHold and counter > 0:
currRate = abs(NextMSDepth-InspectMSDepth)/InspectMSDepth
if currRate >= thresHold:
print("GISID {} - Rate {}".format(InspectGisID, currRate)
gisIDArray += [InspectGisID] Since you need a selection, you would probably want to save the gisids in a table to join and select these records. To join and select use GP-Tools: CreateTable_management to persist selected gisids Use for gisID in gisIDArray: .. insertcursor to append gisID to the table AddIndex_management for the GisID-Fields where the join is based on AddJoin_management to join the new GisID-Table to the original GPS Gas Main Pipe Point Layer with KEEP_COMMON SelectLayerbyAttribute_management with NEW_SELECTION and e.g. OBJECTID >= 0 to select all RemoveJoin_management
... View more
09-12-2018
03:56 AM
|
2
|
7
|
703
|
POST
|
You may want to have a look at the Geoprocessing Tool arcpy.TabulateIntersection_analysis, probably followed by Sort and SummaryStatistics to select best match (first row).
... View more
01-03-2018
02:39 AM
|
0
|
0
|
2784
|
POST
|
I would suggest to use the Geoprocessing Tool "Tabulate Intersect", which is very fast also on huge data: arcpy.TabulateIntersection_analysis("Parcel", "OBJECTID", "Building", r"in_memory\TabIntSum") This results in a Table with the fields - OBJECTID_1 = Parcel-Objectid - AREA = Sum of overlapped Building area - PERCENTAGE = Overlapping Area Percentage You may then use "MakeFeatureLayer" for the parcels, "Add Join" to Join the resulting table by objectid/objectid_1 and "Calculate Field" to populate the desired field. For clean code you should then use "Remove Join" or "Delete" for the Feature layer. If you have overlapping parcels, then you would have to add a "Sort" for the resulting table on "OBJECTID_1 and AREA (Descending)" followed by a summary statistics on the OBJECTID_1 to select first Areas per parcel.
... View more
12-08-2017
12:24 AM
|
1
|
1
|
1167
|
Title | Kudos | Posted |
---|---|---|
3 | 05-11-2022 01:12 AM | |
1 | 10-23-2018 12:21 AM | |
1 | 09-12-2018 07:02 AM | |
1 | 12-08-2017 12:24 AM | |
1 | 09-12-2018 11:45 AM |
Online Status |
Offline
|
Date Last Visited |
05-11-2022
03:16 AM
|