|
POST
|
You are only working with the whole geometry of each feature in your loop. Nowhere are you calling the intersect method. I'm just guessing that geoslabel[i].geometry is the other geometry you want to calculate the percentage with... for (i=0; i< geoslabel.length; i++) {
let querycentroids2 = TradeArea_Data.createQuery();
querycentroids2.geometry = geoslabel[i].geometry;
querycentroids2.where = "year = 2022";
querycentroids2.spatialRelationship = "intersects";
querycentroids2.outFields=["DACODE"];
querycentroids2.returnGeometry = true;
await TradeArea_Data.queryFeatures(querycentroids2)
.then (function (response) {
const values = response.features
for (var a = 0; a < values.length; a++) {
const intersect_geom = geometryEngine.intersect(values[a].geometry, geoslabel[i].geometry);
const intersect_area = geometryEngine.geodesicArea(intersect_geom, 'square-kilometers');
const feature_area = geometryEngine.geodesicArea(values[a].geometry, 'square-kilometers');
const intersect_percent = (intersect_area / feature_area) * 100;
console.log(values[a].attributes['DACODE'], `feature_area = ${feature_area}`, `intersect_area = ${intersect_area}`, `intersect_percent = ${intersect_percent}`);
}
});
}
... View more
11-22-2023
08:32 AM
|
0
|
0
|
2435
|
|
POST
|
Sorry, I don't understand the question. Please clarify your end goal.
... View more
11-22-2023
08:01 AM
|
0
|
1
|
2444
|
|
POST
|
Esri has some documentation about migrating an app from 3.x to 4.x that might be worth reading through. Migrating from 3.x to 4.28 | Overview | ArcGIS Maps SDK for JavaScript 4.28 | ArcGIS Developers There's also a functionality matrix that will help you locate comparable features.
... View more
11-22-2023
06:28 AM
|
2
|
1
|
1961
|
|
POST
|
Indeed, there are geometry functions for Arcade too. Intersection Area
... View more
11-22-2023
06:18 AM
|
0
|
0
|
2461
|
|
POST
|
Yes. percentage = (part/whole)*100 The "part" will be the intersect geometry area and the "whole" is the original feature geometry area.
... View more
11-22-2023
06:15 AM
|
0
|
4
|
2461
|
|
POST
|
If you're working with the Maps SDK for JS, try using the intersect method of the geometryEngine. You would intersect the two geometries, calculate the area of the intersect result, then compare that with the total area of the original feature.
... View more
11-21-2023
01:41 PM
|
0
|
6
|
2549
|
|
POST
|
Using callout lines with labels | Sample Code | ArcGIS Maps SDK for JavaScript 4.28 | ArcGIS Developers
... View more
11-20-2023
07:34 AM
|
1
|
0
|
1226
|
|
POST
|
Schedule geoprocessing tools—ArcGIS Pro | Documentation Scheduling geoprocessing tools usesWindowsTask Scheduler to run the selected tools at a specified time. The geoprocessing tools you scheduled inArcGIS Prodisplay inWindowsTask Scheduler under the name of the task you specified in theSchedulewindow. Check to see if it's in Windows Task Scheduler. Check the triggers and actions tabs to make sure everything looks correct. Check the run history of the task to see if it gives you any messaging. Try running it manually from the Windows Task Scheduler.
... View more
11-15-2023
01:53 PM
|
0
|
1
|
3081
|
|
IDEA
|
I like the idea of a cursor to easily identify deletes. We've had a request from users to track deletes and currently it's not very easy. Identifying deletes after the fact with archiving is possible, but tedious; and it doesn't include editor tracking info for deletes.
... View more
11-08-2023
08:06 AM
|
0
|
0
|
1318
|
|
IDEA
|
I'm trying to build an app that focuses on comparing the different layers in the map and something like this would be great. I'm trying to explore making some kind of interactive legend with the list widget but I can't see how to connect an action to toggle layer visibility. Basically a basemap gallery type of widget but it controls the layers instead of the basemap.
... View more
11-07-2023
02:31 PM
|
0
|
0
|
1964
|
|
POST
|
You can import your Python toolbox and use it in a different, standalone script. Add toolboxes in Python—ArcGIS Pro | Documentation
... View more
11-07-2023
09:26 AM
|
1
|
0
|
1499
|
|
POST
|
If this is running on an enterprise geodatabase (RDBMS), there might be some specific database tuning to help. I'm not a DBA though.
... View more
11-07-2023
06:15 AM
|
0
|
0
|
1380
|
|
POST
|
Truncate is the fastest way to remove all rows from a table. Delete Rows is an alternative, but it is not faster than Truncate. Maybe instead of using an insert cursor, see if Append is any faster.
... View more
11-06-2023
02:01 PM
|
1
|
2
|
1476
|
|
POST
|
Cool, is this for Pokemon Go? If you're using calculate field, I think what you want is: # Expression
setLandmarkType(!LandmarkName!, !LandmarkType!)
# Code block
def setLandmarkType(landmark_name, landmark_type):
if "park" in landmark_name.lower():
landmark_type = "Park"
return landmark_type Be careful though, you will almost certainly get false positives by broadly grabbing anything with "park" in the name. EDIT: I just noticed the part about the Special field for EX Raids... With Calculate Field: # Expression
setSpecial(!LandmarkName!, !Special!)
# Code block
def setSpecial(landmark_name, special):
if landmark_name.lower().endswith(" ex"):
special = "EX Raid"
return special With an update cursor: with arcpy.da.UpdateCursor(path_to_fc, ["LandmarkName", "LandmarkType", "Special"]) as cursor:
for landmark_name, landmark_type, special in cursor:
if "park" in landmark_name.lower():
landmark_type = "Park"
if landmark_name.lower().endswith(" ex"):
special = "EX Raid"
cursor.updateRow([landmark_name, landmark_type, special])
... View more
11-03-2023
02:59 PM
|
0
|
0
|
1455
|
|
POST
|
I really appreciate you posting the solution when you found it. Many people don't, and it's a shame. Could you format the code in a code block?
... View more
11-02-2023
09:34 AM
|
1
|
2
|
3282
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-23-2025 03:53 PM | |
| 1 | 3 weeks ago | |
| 1 | 03-19-2026 08:59 AM | |
| 1 | 02-12-2026 01:37 PM | |
| 1 | 12-01-2025 06:19 AM |