POST
|
Two parts are going on here. First the in check is going to be True every time as it is written. So regardless of the value given it should return either "High frost risk" "Low frost risk" when using "CT" or anything else respectively. Updating, as dan mentioned, to checking if the value is in a list will solve this check. Second part is based on the elif for ST1. When it sees ST1, ST2 or ST3 it proves True and it is going to step into that block. So it will never reach the next check, which incorporates the FIRST_FROS variable. Two possible solutions. 1. invert the elif statements so your FIRST_FROS check comes before the check without FIRST_FROS. 2. add a nested if within the ST1... check to see if that FIRST_FROS check is True or not. Option 1 def reclass(FIRST_KOPP , FIRST_FROS):
if FIRST_KOPP in ['CT']:
return "High frost risk"
elif FIRST_KOPP in ['ST1', 'ST2', 'ST3'] and FIRST_FROS in ['Moderate frost risk', 'High frost risk']:
return "Low frost risk"
elif FIRST_KOPP in ['ST1', 'ST2', 'ST3']:
return "Frost free"
elif FIRST_KOPP in ['ST4', 'ST5', 'ST6', 'ST7', 'ST8', 'ST9']:
return "Frost free"
elif FIRST_KOPP in ['WT'] and FIRST_FROS in ['Frost free']:
return "Low frost risk"
else:
return FIRST_FROS Option 2 def reclass(FIRST_KOPP , FIRST_FROS):
if FIRST_KOPP in ['CT']:
return "High frost risk"
elif FIRST_KOPP in ['ST1', 'ST2', 'ST3']:
if FIRST_FROS in ['Moderate frost risk', 'High frost risk']:
return "Low frost risk"
else:
return "Frost free"
elif FIRST_KOPP in ['ST4', 'ST5', 'ST6', 'ST7', 'ST8', 'ST9']:
return "Frost free"
elif FIRST_KOPP in ['WT'] and FIRST_FROS in ['Frost free']:
return "Low frost risk"
else:
return FIRST_FROS
... View more
02-16-2022
06:06 AM
|
0
|
0
|
394
|
POST
|
Would the CIM be able to update what you’re looking for? https://pro.arcgis.com/en/pro-app/2.8/arcpy/mapping/python-cim-access.htm https://github.com/Esri/cim-spec/blob/master/docs/v2/CIMMap.md
... View more
02-16-2022
04:59 AM
|
0
|
0
|
367
|
POST
|
Hello, Not a question, but sharing a helpful tool to symbolize a feature class while preventing color conflicts between individual features. Basis is the five color theorem (https://en.wikipedia.org/wiki/Five_color_theorem ) where features that touch each other can't share the same color, but the fewest colors are used to symbolize a dataset. Example is to color every country of the world, with the fewest colors possible. Tool takes a layer from an active map in ArcGIS Pro (tested in 2.8), and groups the rows in such a way that there is no conflicts between interconnected features based on a field selection. As it uses networkx, the default environment should be cloned, and networkx installed prior to use. https://github.com/namur007/ArcGIS-Pro-Color Curious on feedback if anyone finds this helpful.
... View more
02-14-2022
01:15 PM
|
0
|
0
|
493
|
POST
|
Hi Bjorn, That’s not quite what I’m looking for. something more along the lines what defines the XML spec in desktop/pro.
... View more
08-06-2021
09:36 AM
|
0
|
0
|
568
|
POST
|
TLDR: write metadata information in your python toolbox in markdown and generate XML from it. GitHub - PYT-Metadata Good day, Wanted to share a helpful tool I’ve created for python toolbox metadata. The goal is to store the entire structure of a project as self contained as possible, including the metadata. This led to me coming up with a tool to store and generate the metadata from a combination of arcpy Parameters and a custom dictionary, written as markdown strings in python. A nice side benefit is it lets you incorporate HTML elements not supported by default, such as code blocks. Hopefully someone else finds it as useful as I have!
... View more
07-26-2021
12:50 PM
|
6
|
0
|
579
|
POST
|
Hello! Would anyone know if there is a publicly available spec file/site for the ESRI/ArcGIS/Item Description metadata spec? It seems to have various names, likely for the same thing. It sounds like it is a derivative/inspired by the FGDC CSDGM and ESRI-ISO specs, but with variations from them. thanks!
... View more
07-22-2021
11:30 AM
|
0
|
3
|
647
|
POST
|
Out of curiosity, it looks like you're writing to a dropbox location based on the input/output. Have you tried writing to a folder that isn't a dropbox path? Ignoring the suggestions above for now, does that work with your original code? There might be some funny sync things happening between dropbox and the folder if you're writing a file continuously to it from python. Volume wise, if you're using a da.search cursor it shouldn't matter if it's 10 rows or 4.7 million in terms of memory usage.
... View more
09-28-2020
08:37 AM
|
2
|
1
|
3993
|
POST
|
Awhile back i had helped someone by making this gist. Its using the multiprocessing library to do parallel calculations on a data set. This is generally the setup i use, specifically queue based so you are always trying to let every process pull a value from a shared pool. Multiprocessing ArcGIS/Arcpy · GitHub If i recall i had changed it slightly to not use queue.empty and just wrapped it in a try:catch: instead to avoid some other issues. that one doesn't show it, but it's easy to modify. Feel free to ask if you have any questions on it. update: arcpy_multiprocessing_template/Toolbox/code at master · namur007/arcpy_multiprocessing_template · GitHub This one should have the proper logic
... View more
07-07-2020
01:11 PM
|
0
|
0
|
733
|
POST
|
Heres what i was thinking: You'll also need the solve_eq from the previous work from collections import namedtuple
def calculate_xy_path(_start, _end, _sag, density=None):
l_x = np.linspace(_start.x, _sag.x, density)
r_x = np.linspace(_sag.x, _end.x, density)
l_y = np.linspace(_start.y, _sag.y, density)
r_y = np.linspace(_sag.y, _end.y, density)
l_z = calculate_z_path(_start, _sag, density)[::-1]
r_z = calculate_z_path(_sag, _end, density)
return Path(x=l_x, y=l_y, z=l_z), Path(x=r_x, y=r_y, z=r_z)
def calculate_z_path(_start, _end, density):
distance = math.sqrt(((_start.x - _end.x)**2) + ((_start.y - _end.y)**2))
sag_value = abs(_start.z - _end.z)
bottom_value = min(_start.z, _end.z)
_path = np.linspace(0, distance, density)
c = solve_eq(sag_value, distance, max_decimals=3)
_z_path = ((c * np.cosh(_path/c))-c)
_z_path = np.clip(_z_path, 0, sag_value)
return _z_path + bottom_value
Point = namedtuple("Point", "x y z")
Path = namedtuple("Path", "x y z")
start_point = Point(x=300, y=300, z=50)
end_point = Point(x=400, y=400, z=50)
sag_point = Point(x=350, y=350, z=40)
left_path, right_path = calculate_xy_path(start_point, end_point, sag_point, 20)
full_path = Path(
x=np.concatenate((left_path.x, right_path.x)),
y=np.concatenate((left_path.y, right_path.y)),
z=np.concatenate((left_path.z, right_path.z))
) Then to test plot import matplotlib.pyplot as plt
fig = plt.figure(figsize=(10,10))
ax = fig.add_subplot(111, projection='3d')
ax.plot(full_path.x, full_path.y, full_path.z)
for p in [start_point, sag_point, end_point]:
ax.scatter([p.x], [p.y], [p.z], c='r')
... View more
06-19-2020
08:17 AM
|
0
|
1
|
1621
|
POST
|
I'm pretty sure your data is indicating you have different elevations on either end, otherwise the distance to the sag would be in the middle of the curve. As a quick thought (this will need tweaking) For graphs with different elevations your basically solving the left side then the right side. For each side you're going to figure out what the curve scale is (from function provided) Calculate Z difference from Start Z to Sag Z Calculate the distance between start XY and sag XY (this you should already have based on your table) Solve left side using above as inputs. Lets call it L_CURVE_VALUE Determine the XY locations between the start and mid point (something like np.linspace for each of the X and Y should give you a sufficiently density of array of values for your curve). For example lets say you get 100 points between the start and sag Given that your Sag point XY is 0, use something like np.linspace to create array of points from 0 to your distance (start to sag). Use same number of points as XY locations above. lets call this Z_map Plug that Z_map into the formula ((L_CURVE_VALUE * np.cosh(Z_map/L_CURVE_VALUE)) - L_CURVE_VALUE) this is the array of the curve Z points based on your inputs. Let call this Z_TABLE Add the Sag Z elevation to the Z_TABLE. This will put it into your proper vertical location, otherwise it would be Z values from 0 to N (being the start elevation). Call this Z_Locations Repeat for other side (using different variables for X, Y, Z locations). Join left side and right side locations together (making sure it goes from Start to Sag, Sag to End in your arrays). use these as inputs in the arcpy.polyline when creating a new line between points.
... View more
06-17-2020
06:34 AM
|
0
|
3
|
1621
|
POST
|
ah! sorry i thought i was replying to Hugo, but didn't look close enough! Cheers!
... View more
06-16-2020
12:58 PM
|
0
|
0
|
1621
|
POST
|
awesome. that array in the gist should be [distance from start to sag, distance from sag to end, start Z, sag Z, end Z]. I'm curious if you run it on some of your data with different start/end elevations how the profile plots too. the function should let you generate your Z locations for your polyline vertexes, which you would just need to calculate over the start to end for the feature. essentially that would be the % along the line from start to sag/sag to end for the respective functions. then just use arcpy to update the polyline with your new vertex attributes. do this for ever feature and you should be set!
... View more
06-16-2020
11:36 AM
|
0
|
2
|
2127
|
POST
|
Yes, the curve will change based on the distance and elevation. If you already know the start/sag/end XYZ you should be able to solve the curve for the shape though through some iteration. i did this as a quick test that you're welcome to try/confirm if correct or not. Catenary Curve · GitHub
... View more
06-16-2020
08:27 AM
|
1
|
6
|
2127
|
POST
|
Are you trying to model a catenary curve between your points then? From my understanding that's the curve that would match a cable hanging problem like you've described. I might have a solution but since the scale of the curve is dependent on the horizontal/vertical distance of the points it would be nice to try with some confirmed data. Are you able to share a few of your sample locations? If you'd like to dummy them up all I really need is horizontal distance between start and sag, sag and end, and the vertical locations of the start, sag and end. You could also just represent the sag location as a % of the whole distance if you'd like to generalize more. Important bit is vertical locations. Example: ID Start to Sag (m) Sag to End (m) Start Z Sag Z End Z 1 5 (50% of total) 5 50 30 50 2 8 (44.444% of total) 10 30 20 40
... View more
06-16-2020
04:57 AM
|
0
|
13
|
2127
|
POST
|
out of curiosity do you know the XYZ for each of the Start, End and Sag points?
... View more
06-15-2020
08:47 AM
|
0
|
15
|
2127
|
Title | Kudos | Posted |
---|---|---|
6 | 07-26-2021 12:50 PM | |
1 | 06-16-2020 08:27 AM | |
2 | 09-28-2020 08:37 AM | |
2 | 06-05-2020 08:45 PM | |
1 | 02-28-2014 08:04 AM |
Online Status |
Offline
|
Date Last Visited |
06-08-2022
01:12 PM
|