|
POST
|
Because your height attribute is a floating point number and doing calculations on floating point numbers in the binary system is imprecise. If you want further information why this is the case, here are two good starting points: https://stackoverflow.com/questions/588004/is-floating-point-math-broken https://stackoverflow.com/questions/21895756/why-are-floating-point-numbers-inaccurate
... View more
07-21-2023
06:58 AM
|
0
|
0
|
1655
|
|
POST
|
Field Calculator, language = Python: # ModeField =
get_mode(!Field1!, !Field2!, !Field3!, !Field4!)
# code block
import statistics
def get_mode(*args):
return statistics.mode(args)
... View more
07-20-2023
01:17 PM
|
1
|
3
|
4150
|
|
POST
|
I don't think GroupBy is exactly the right choice here. It does group the features, but then you still have to filter for your current ParentPropertyID. Might as well filter first and then call Sum(). var id = $feature.ParentPropertyID
var fs = Filter($featureset, "ParentPropertyID = @ID")
return Sum(fs, "GIS_TractAcres")
... View more
07-20-2023
12:18 PM
|
0
|
0
|
1367
|
|
POST
|
They're reading the outputField property, change it, and then set it to the changed value. Here's the doc for the outputField property: outputField (Read and Write) The properties of the output field are either set or returned in a Field object. Field So outputField is a Field object. Why don't they construct a brand-new Field and set outputField to that? Well, let's look at Field's properties: That's a lot of properties you'd have to set. Granted, you probably only really need name and type, but maybe some other properties are important for your use case. And the FieldMap object automatically sets these properties to appropriate values. So the easier way is to get this automatically created Field object, change one of it's properties (name) and give it back to the FieldMap. I really wish there was an easier way to achieve this, the fieldmap/fieldmappings approach seems really arcane. I've never really used FieldMap, but I agree, this isn't the simplest way. If you know your input fields, you can just execute an Append or Merge manually and copy the Python code from the Geoprocessing History. Alternatively, you could do it with the arcpy.da.*Cursor objects.
... View more
07-20-2023
09:39 AM
|
3
|
5
|
7967
|
|
POST
|
Select Layer By Attribute will be very slow for that many features. You could use your query to make a new layer with Make Feature Layer. This layer will contain only features that you want to delete, so just select them all and delete. Or you could d o it with a little Python script: layer = "LayerName"
query = "SomeField = 'DELETE ME'"
with arcpy.da.UpdateCursor(layer, ["OID@"], query) as cursor:
for row in cursor:
cursor.deleteRow() These will edit your shapefile, so make a backup!
... View more
07-20-2023
02:34 AM
|
0
|
0
|
1864
|
|
POST
|
Here's one way to do it: Copy/paste the script into your ArcGIS Pro Python Window and execute. This will define a function 'straighten_points'. import numpy
def straighten_points(layer, fit_degree=1):
"""Snaps all (selected) points in a layer to a regression line. This edits the input layer!
layer: layer name (str) or layer object (arcpy.mp.Layer)
fit_degree (int): degree of the polynomal fit, defaults to 1 (linear regression)
"""
sr = arcpy.Describe(layer).spatialReference
# extract point coordinates
points = [r[0].firstPoint for r in arcpy.da.SearchCursor(layer, ["SHAPE@"])]
x = [p.X for p in points]
y = [p.Y for p in points]
# polynomial fit
coef = numpy.polyfit(x, y, fit_degree)
polynom = numpy.poly1d(coef)
# construct fit line geometry
fit_xy = [
[x_, polynom(x_)]
for x_ in numpy.linspace(min(x) - 1000, max(x) + 1000, 100)
]
fit_points = [arcpy.Point(fx, fy) for fx, fy in fit_xy]
line = arcpy.Polyline(arcpy.Array(fit_points), spatial_reference=sr)
# snap points to regression line geometry and update layer
with arcpy.da.UpdateCursor(layer, ["SHAPE@"]) as cursor:
for p, in cursor:
new_p = line.snapToLine(p)
cursor.updateRow([new_p]) Select the points you want to straighten Run the function. Using 1 does a linear regression, which should be fine for straight road segments. For curves, you could try 2 or higher degrees, but remember that using this function will edit the layer, so make a backup. straighten_points("NameOfYourLayer", 1) Before: After (northern road: fit_degree = 1, southern road: fit_degree = 2:
... View more
07-19-2023
03:31 PM
|
2
|
0
|
1663
|
|
POST
|
As Dan said, you could set it to Derived, that will show the "No parameters" message. Alternatively, you can just reset the parameter's value in the updateParameters() method: class Tool(object):
def __init__(self):
self.label = "Tool"
self.description = ""
self.canRunInBackground = False
def getParameterInfo(self):
return [
arcpy.Parameter(name="code", displayName="Land Use Code", datatype="GPString", parameterType="Required", direction="Input")
]
def updateParameters(self, parameters):
parameters[0].value = "9999 - Not Classifiable"
def updateMessages(self, parameters):
parameters[0].setWarningMessage("This parameter is for information only, you can't edit it.")
def execute(self, parameters, messages):
return
... View more
07-17-2023
04:04 PM
|
0
|
0
|
2713
|
|
POST
|
Yes, this is a task Attribute Rules are somewhat commonly used for. As an entry point: https://www.esri.com/arcgis-blog/products/arcgis-pro/data-management/advanced-gdb-attribute-rules-editing-external-features-with-attribute-rules/ To edit another table, you return a dictionary instead of a simple value. This dictionary requires certain keys, they are documented here: https://pro.arcgis.com/en/pro-app/3.0/help/data/geodatabases/overview/attribute-rule-dictionary-keywords.htm
... View more
07-17-2023
12:58 PM
|
1
|
0
|
1841
|
|
POST
|
There doesn't seem to be an option to specify the breakpoint for switching between the views. But you can modify your dashboard link to always open a specific view: https://doc.arcgis.com/en/dashboards/latest/create-and-share/url-parameters.htm Dashboard view parameters When a dashboard opens, the optimal view of the dashboard automatically loads. If you have created a mobile view for your dashboard, that view loads when opened on mobile devices. When opened on a desktop, the desktop view loads. You can change the view by adding the appropriate dashboard view parameter to your dashboard's URL. The view=mobile parameter loads the mobile view. The view=desktop parameter loads the desktop view.
... View more
07-17-2023
12:53 PM
|
4
|
0
|
6557
|
|
POST
|
There is Features To JSON and the reverse JSON To Features.
... View more
07-16-2023
12:34 AM
|
0
|
0
|
1093
|
|
POST
|
The text element has two modes. The first mode is a "what-you-see-is-what-you-get" editor. This will not interpret HTML (You can see that it didn't only "break" your link, it also didn't interpret the strong tag or the entities). You can write your text in here and then create the link with the editor tools. Or you can switch to HTML mode. This mode is an HTML editor. It will interpret HTML code put into it (a small subset anyway).
... View more
07-14-2023
11:48 PM
|
0
|
1
|
1354
|
|
POST
|
Hmm, does it work if you filter the related table yourself? var rel_fs = FeaturesetByPortalItem(...)
var common_val = $feature.CommonField
var rel_rows = Filter(rel_fs, "CommonField = @common_Val")
return Count(rel_rows)
... View more
07-14-2023
05:10 PM
|
0
|
1
|
1161
|
|
POST
|
Well, you could implement your rules as Batch Calculation Rules and execute them with Evaluate Rules, which isn't quite one-click, but it doesn't take too long to start. But that is probably not the route you want to take, since I think you have implemented (almost) all of your rules as Immediate Calculation Rule. For these rules to be executed, you have to trigger them. The rules you care about in this scenario will be triggered on updates, so just update your features. You can do it manually, or you can do it with Calculate Field. Doing it with the tool has benefits: faster possible automation (write a little Python script or ModelBuilder model) you don't actually have to change values. Just returning the value that is in the field will trigger update rules. honors the selection in the layer, only those features will be updated Take any editable field and do something like this:
... View more
07-14-2023
04:46 PM
|
1
|
0
|
3050
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 01-30-2023 09:57 AM | |
| 1 | 05-18-2023 12:51 AM | |
| 1 | 03-05-2023 12:46 PM | |
| 1 | 12-07-2022 07:01 AM | |
| 1 | 06-21-2022 08:27 AM |
| Online Status |
Offline
|
| Date Last Visited |
02-03-2024
06:14 PM
|