|
POST
|
I think what you want to do is Union the first three polygons into a new polygon. Merging three layers/data sets with a single polygon into a new data set simply creates a new data set with 3 polygons. If you want a singular polygon, you need to union them into a new polygon.
... View more
05-03-2021
07:24 AM
|
0
|
1
|
4011
|
|
POST
|
My recommendation, install and configure an Anaconda environment to work with Visual Studio, then install Arcpy :: Anaconda.org.
... View more
05-03-2021
07:20 AM
|
3
|
0
|
5834
|
|
IDEA
|
@KoryKramer , I know this is a lost cause, but I have to bring it up, again. It has been nearly 3 years since this issue was logged and "the team" supposedly made aware of it. Is the goal at this point just have the mobile geodatabase completely supplant the file geodatabase and the issue of documenting pattern matching in file geodatabases is moot?
... View more
04-30-2021
11:47 AM
|
0
|
0
|
2562
|
|
POST
|
@badrinathkar, this is a duplicate of https://community.esri.com/t5/arcmap-questions/how-to-calculate-mean-of-a-field-considering-only-values-greater/m-p/1053307#M2433, which already has a response. Please delete this one.
... View more
04-30-2021
11:14 AM
|
0
|
0
|
1522
|
|
POST
|
Lots of ways to accomplish this, here is one: from statistics import mean
tbl = # path to table
with arcpy.da.SearchCursor(tbl, "Count") as cur:
avg = mean(row[0] for row in cur if row[0] > 0)
... View more
04-30-2021
10:27 AM
|
1
|
1
|
1461
|
|
POST
|
On my machine with Pro, I don't have or use quotes around my sheet names and everything works fine. >>> import arcpy
>>>
>>> # pass Excel worksheet with no quotes to search cursor
>>> with arcpy.da.SearchCursor(r"E:\tmp\sample.xlsx\Sheet1$", "*") as cur:
... for row in cur:
... print(row)
...
(10.0, 'g', 10.3, 1)
...
(22.0, 'i', -1.5, 11)
>>>
>>> # pass Excel worksheet with single quotes to search cursor
>>> with arcpy.da.SearchCursor(r"E:\tmp\sample.xlsx\'Sheet1$'", "*") as cur:
... for row in cur:
... print(row)
...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
RuntimeError: cannot open 'E:\tmp\sample.xlsx\'Sheet1$''
>>>
... View more
04-30-2021
08:13 AM
|
2
|
3
|
4631
|
|
POST
|
In this case, ArcPy cursors are simply iterables to tee, and the cursors are treated just like tee would treat any other iterable when splitting it. The itertools — Functions creating iterators for efficient looping — Python 3.9.4 documentation states: Once tee() has made a split, the original iterable should not be used anywhere else; otherwise, the iterable could get advanced without the tee objects being informed. For ArcPy cursors, the iterators returned back from tee do not have an updateRow() method, which is why I refer back to the cursor object to update the row. That said, you will notice that I am not iterating the original cursor because doing so would create a situation where the tee iterators miss rows of data. ArcPy cursors are "forward-only" cursors, meaning they can only move one direction through the data set once defined. Once the cursors has visited row x+1, it can't go back to row x unless the cursor is reset, which takes the cursor back to the start of the data set. Since ArcPy cursors are forward-only, the tee iterator that is furthest through the data set determines where the original cursor object is in the data set.
... View more
04-30-2021
08:11 AM
|
1
|
1
|
4246
|
|
POST
|
Remove the single quotes from around the worksheet name.
... View more
04-29-2021
06:40 PM
|
0
|
5
|
4663
|
|
POST
|
When working with file system paths in Python 3.4+, I strongly encourage people to switch to using 11.1. pathlib — Object-oriented filesystem paths — Python 3.6.13 documentation. >>> from pathlib import Path
>>>
>>> shp_path = r"C:\Cases\blah\2020 blah\yoyo\folder1\shapefile.shp"
>>> path = Path(shp_path)
>>> print(path.parents[1])
C:\Cases\blah\2020 blah\yoyo
>>>
... View more
04-28-2021
10:50 AM
|
1
|
1
|
4014
|
|
POST
|
Try: GETDATE() BETWEEN StartDate and DATEADD(day, 45, EndDate) or GETDATE() >= StartDate AND GETDATE() <= DATEADD(day, 45, EndDate)
... View more
04-26-2021
10:57 AM
|
0
|
1
|
2841
|
|
POST
|
There is a fair amount of nuance/difference in how different DMBSs implement Date/Time SQL support. Which back-end DBMS are you working with?
... View more
04-26-2021
07:44 AM
|
0
|
3
|
2876
|
|
POST
|
Can you elaborate more on how exactly you are going about your calculations, and how are you determining the outputs are incorrect? For example, are you creating basic square polygons of 1 yard x 1 yard and looking at the area field ArcGIS calculates?
... View more
04-21-2021
07:15 AM
|
1
|
2
|
4008
|
|
POST
|
There are a couple of handy things about tee that aren't used in this simple situation. For example, you can split an iterable into as many independent iterators as you like, it doesn't have to be just two. Since the iterators are independent of each other, each can be at a various spot. The tricky part with update cursors is that the furthest ahead iterator determines where the underlying cursor is in terms of the dataset, which is why "look-behind" calculations can be done but not "look-ahead" if you want to update the dataset in one pass.
... View more
04-21-2021
07:05 AM
|
0
|
1
|
4304
|
|
POST
|
I agree with @JohannesLindner that this is best handled using cursors instead of Field Calculator. If you are interested in doing a "look-behind" calculation, you can do it with a single pass of an update cursor. from itertools import tee
tbl = # path to table or feature class
with arcpy.da.UpdateCursor(tbl, ["Frequency", "value"], sql_clause=(None, "ORDER BY Id")) as cur:
n1, n = tee(cur)
row_n1 = next(n1)
for row_n1 in n1:
row_n = next(n)
cur.updateRow([row_n1[0], row_n[0]/row_n1[0]])
... View more
04-20-2021
12:46 PM
|
2
|
1
|
4319
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-11-2026 07:04 AM | |
| 1 | 07-17-2026 06:54 AM | |
| 2 | 07-06-2026 12:29 PM | |
| 1 | 07-06-2026 12:00 PM | |
| 2 | 06-05-2026 10:30 AM |
| Online Status |
Offline
|
| Date Last Visited |
Friday
|