|
POST
|
You can complete this task with some python scripting which you can run directly within ArcPro from the python console. Here is an example table of my input layer, 12 rows with the values I want to put into quartile classes in the field Value and QClass is the field to record which class they are in, note the rows are all NULL as the code has yet to be run.: The code you drop into the python console is this, you just need to change the layername and fields in the search and update cursors to match your data.: import arcpy, numpy
layername = "testdata" # Name of layer as seen in TOC
lstValues = list() # list to store values in
# Read values into list
with arcpy.da.SearchCursor(layername, "Value") as cursor:
for row in cursor:
lstValues.append(row[0])
# Use numpy to compute quartiles
q25 = numpy.percentile(lstValues, 25)
q50 = numpy.percentile(lstValues, 50)
q75 = numpy.percentile(lstValues, 75)
print("Q25 = " + str(q25))
print("Q50 = " + str(q50))
print("Q75 = " + str(q75))
# Write quartile class back to layer
with arcpy.da.UpdateCursor(layername, ["Value","QClass"]) as cursor:
for row in cursor:
v = row[0] # The value
if v < q25:
row[1] = 25
elif v >= q25 and v < q50:
row[1] = 50
elif v >= q50 and v < q75:
row[1] = 75
else:
row[1] = 100
cursor.updateRow(row)
Print("Finished!") The results are shown, sorted by QClass:
... View more
10-27-2023
09:20 AM
|
1
|
1
|
1995
|
|
POST
|
What you described work for me, my input rasters were tested as TIF and file geodatabase rasters, fed into a collects tool and that sub model connected correct with cell statistics. It would suggest the problem is in your sub-model and as you don't show it, no one can help you.
... View more
10-27-2023
08:29 AM
|
0
|
0
|
676
|
|
POST
|
I think the short answer is no. It's a cosmetic bug in model builder. You can click on that single line and drag out the links to new positions.
... View more
10-27-2023
08:11 AM
|
0
|
0
|
803
|
|
POST
|
I think to give people a chance to help you, you need to attach to your question the layer file with the symbology as what you show could no doubt be created multiple ways and which way you have done it will dictate the solution (if any).
... View more
10-17-2023
04:58 AM
|
0
|
0
|
1106
|
|
POST
|
If you look at the tool in toolbox you will observe that it has a script icon which means its a python script and these you can look at the source to fully understand what the tool is doing. Simply right click on tools and select > properties > Execution. If you search the source code for the lines that have arcpy.Polyline() this is where they construct the polyline geometry from an array object and if you search for the array you simply observe them adding points to it. So no fancy conversion is happening. From this you can conclude that the lines built are in the coordinate system you have provided the points in, in your case looks like WGS84. You need to go back to the person who supplied them to you to see if they were constructed in a specific manner.
... View more
10-17-2023
04:46 AM
|
0
|
1
|
1629
|
|
POST
|
You could explore the Collect Events tool to count your stacked points then use that new layer to select only 2-count points then you can do the select by location using those selected subset? I have to say questions like yours are ALWAYS better if accompanied with a screen shot/sketch as you have obfuscated the nature of your dataset by not saying what it is, rivers, roads, shipping lanes etc...
... View more
10-17-2023
04:24 AM
|
0
|
0
|
3099
|
|
POST
|
Thanks for the advice, this was the approach I was hoping to avoid! 😁 Interesting stuff about I/O.
... View more
10-02-2023
02:02 AM
|
0
|
0
|
2422
|
|
POST
|
If you want assistance, it will help if you state which software you require assistance in as the syntax is applicable to ArcMap or ArcPro... Edit your question, don't just simply reply to this as others then have to trawl through a pointless conversation. ALSO format your code (via the 3 dots), its difficult to read and indentation is critical in python. A question where you have put time and effort in formatting and providing all the required information gets answered a lot quicker!
... View more
09-26-2023
09:38 AM
|
0
|
0
|
894
|
|
POST
|
That's a really useful white paper, some quality bed time reading for me! Thanks.
... View more
09-26-2023
07:55 AM
|
0
|
0
|
3862
|
|
POST
|
To loop within models you need to be using an iterator. Explore help file and look at the examples.
... View more
09-26-2023
06:05 AM
|
0
|
0
|
2596
|
|
POST
|
This page discusses how ArcPro deals with precision and tolerance: https://pro.arcgis.com/en/pro-app/latest/help/data/geodatabases/overview/the-properties-of-a-spatial-reference.htm Without talking to the developers that's as much as you are going to find out which is published.
... View more
09-26-2023
04:32 AM
|
0
|
1
|
3913
|
|
POST
|
I see a basic flaw in your model. Golden rule is EVERYTHING runs as many times as the iterator loops. EVERYTHING means stuff feeding into the iterator and unconnected parts of your model with or without preconditions. So knowing that fact, what do you think your create file geodatabase tool is doing? It's creating the database X number of times... The solution is to embed models within models. Have a master model with your create file geodatabase tool acting as a precondition to a sub-model. The sub-model containing the iterator and connecting logic. You then run the master model. Create geodatabase runs ONCE then logic feeds into sub-model with it's iterator. Refer to help file on topic of embedding models. You'll need to take this approach if you also want loops within loops.
... View more
09-26-2023
04:25 AM
|
0
|
1
|
2108
|
|
POST
|
Hard to say, you reference software that was made obsolete more than 20 years ago! So shapefiles are more than 20 years old. How ArcPro reconciles precision may be quite different to software that was built 20 years ago, especially as data formats have matured, such as the file geodatabase. I would always recommend using shapefiles as a last resort and use file geodatabases as they are superior in their functionality and storage capacity. I would imagine the article is still relevant to shapefiles, a format that is now over 20 years old.
... View more
09-26-2023
04:15 AM
|
2
|
1
|
3920
|
|
POST
|
I'm really surprised that you can have a featureclass inside a featuredataset with the same name as the featuredataset. As a first test try renaming the DT featureclass to something else then run your code, what do you get then?
... View more
09-26-2023
03:58 AM
|
0
|
3
|
1327
|
| Title | Kudos | Posted |
|---|---|---|
| 2 | 2 weeks ago | |
| 1 | 12-03-2025 04:30 PM | |
| 1 | 12-03-2025 04:06 PM | |
| 1 | 12-03-2025 04:17 PM | |
| 1 | 12-02-2025 07:05 AM |
| Online Status |
Offline
|
| Date Last Visited |
Wednesday
|