|
IDEA
|
The "centroid inside" option should exist for the Spatial Join tool, too. Do the Select By Location and Spatial Join tools use the same code/logic?
... View more
02-21-2019
12:23 PM
|
1
|
0
|
2269
|
|
IDEA
|
I would also like to see the capability to redirect. I was thinking it could be triggered by marking an item as deprecated, which Esri rolled out after this idea was originally posted (Dec. 2017). This seems like a natural extension of metadata: if an item is deprecated, it should have a pointer to the superseding item. Both on the back-end and user-facing. Which leads to a related request: There should be an obvious marker on the item itself if it has been deprecated, not just on its item information page which many people will never see. I'm envisioning a system-generated splash widget that informs the user of the item's deprecated status and offers a link to the superseding item. It would be the item creator's option to force the user to redirect to the new item or allow them to proceed to the deprecated item.
... View more
02-04-2019
07:09 AM
|
3
|
1
|
7419
|
|
POST
|
Looks this idea has already been submitted: https://community.esri.com/ideas/12157 Well over 2 years ago and not too many upvotes. Please add your vote if you'd like to see this!
... View more
02-04-2019
06:58 AM
|
12
|
0
|
7556
|
|
POST
|
Glad you like my hack. Yes, you are understanding correctly what I'm wanting to do. And I think I understand what you're saying about changing the item URL. It's just another way of swapping out the map used in a particular app. Unfortunately, that's not what I need in this situation. I want to change the app itself beyond what is possible without simply creating a new app and therefore new URL. Update on my scenario 1 above: I can edit the app now, after being granted admin rights. The app was originally created by someone else and ownership was transferred to me, but apparently ownership doesn't give me editing rights. I don't understand why that is, but regardless, that problem is solved. The next problem is, there are very few things that can be edited. Notably, the template does not have the option to add a splash screen, so I can't use the hack I devised. And of course, you can't change the template without creating a whole new app and URL. (You do have the option of switching themes if the app was built with Web AppBuilder, but this app was not.) So, I'm stuck unless the redirect functionality I've described here is implemented by Esri. I will post that idea to the Ideas section. Thanks!
... View more
02-01-2019
01:49 PM
|
2
|
2
|
7556
|
|
POST
|
If I'm designing a new map or app to replace an old one, I don't want to simply delete the old one that many people have bookmarked. I also don't want them to continue using the old one, intentionally or not. As determined here, you cannot swap out one item for another using the same URL. Alternatively, I'd like to repurpose the old app's URL into a redirection notice. What is the best way to that? I could put a link to the new app in a splash widget (if it's possible to edit the app - see below), but that still allows the user to dismiss the notice and continue using the old app. (This is the best hack I could come up with: http://bit.ly/AGOLRedirectHack.) I could delete or disrupt the functionality of the map the app points to, but that isn't particularly elegant. (And there are probably some bookmarks pointing directly to the map rather than the app, which is another whole issue.) It would be nice if AGOL had some sort of built-in redirection method that notifies the user of the new app and makes the old app inaccessible. Marking the old app as deprecated could trigger this capability. Currently, deprecating an item does absolutely nothing to inform someone who arrives directly at the app (never having seen the item details page) about its status. For that matter, this functionality should exist for any kind of item in AGOL. Why would you need to create a whole new map or app rather than simply updating the old one? I can think of at least 2 scenarios: 1. The old app is so old or was originally made in whatever manner that there's no option to edit it through AGOL. (that is the problem I'm currently facing) 2. You want to develop and test a new app over a long period of time before making it live. Once it's ready, you'll swap out the old for the new. The second scenario especially seems like something that would be commonly desired, yet AGOL doesn't provide an easy way to accomplish. Unless I'm missing something, which is what I'm trying to figure out. Else, this post probably ought to be changed into a feature request. Thank you for any insight!
... View more
01-30-2019
01:56 PM
|
6
|
5
|
8556
|
|
IDEA
|
I understand performance is a problem, but would it be possible to cache the selection set? E.g., You open the map and the layer with the spatial query grabs an up-to-date snapshot and caches it (or a portion of it, like Feature Cache in ArcMap) and remains static for the rest of the session or until the user chooses to manually refresh. This wouldn't work for constantly changing data, but it seems like it would work fine if the data only needs to be refreshed daily or weekly, and it's being used as a reference more than for active editing. Maybe that's too big of a caveat to bother explaining or implementing, but I think it would be worthwhile.
... View more
01-28-2019
12:14 PM
|
0
|
1
|
3848
|
|
POST
|
I was enjoying the new legend patch shape-changing capabilities of Pro 2.3, but I've come across what seems to be a bug. If I choose the circle shape (all other shapes seem fine), it ignores the patch width set in the legend property. Which then causes misalignment with legend entries and text using other patch shapes. Am I missing something or is this in fact a bug? In the example below, all legend items have a patch width of 24 pt.
... View more
01-25-2019
10:56 AM
|
0
|
0
|
602
|
|
POST
|
I've seen many similar questions but somehow never found an answer that I can understand and apply to my problem. I have a layer with Census tracts. I have a layer with parcels. I need to iterate through each tract, select the parcels falling inside, do some things to the parcels (for the sake of testing, I'm trying to copy the parcels in each tract into a new feature class named with the tract number), then repeat for the next tract. The loop works, insofar as it runs through each tract and creates a new feature class that is named with the tract number. But rather than each feature class containing only the parcels falling inside the respective tract, each resulting feature class includes all parcels falling inside all tracts. I'm clearly missing some important construct in my loop. Please help! with arcpy.da.SearchCursor("tracts", "TRACT_NUMBER") as cursor:
for row in cursor:
arcpy.SelectLayerByLocation_management("parcels","HAVE_THEIR_CENTER_IN","tracts")
arcpy.CopyFeatures_management("parcels", "parcels_"+"{}".format(row[0]))
... View more
11-13-2018
07:31 PM
|
1
|
5
|
9545
|
|
POST
|
I should know better than to assume anything will work in Pro without qualification. I'm sorry, I'm not sure what to tell you about the traceback from Pro other than: Traceback (most recent call last):
File "<string>", line 7, in <module>
RuntimeError: 'in_table' is not a table or a featureclass Line 7 in the error message is the same line 7 from your original script above.
... View more
11-08-2018
12:01 PM
|
0
|
1
|
3204
|
|
POST
|
OK, I just ran it in PyScripter and it worked fine. (D'oh, should've tried that before.) I also just tried it from the Python window in ArcMap 10.6 and it worked fine. My folly was trying to run it from the Python window in Pro. Must be a syntax change in Pro? Python 2.7 vs. 3.0? In Pro, I've tried several variations for the in_table variable: tbl = "C:\\Users\\thomasj\\Desktop\\Current\\NearTable1.dbf" tbl = "C:\\Users\\thomasj\\Desktop\\Current\\Current.gdb\\NearTable1" tbl = r"C:\Users\thomasj\Desktop\Current\Current.gdb\NearTable1" tbl = "NearTable1" (dragged and dropped from Contents in Pro) Always resulting in the same "in_table" error. You are awesome; thank you for all your help!
... View more
11-08-2018
09:45 AM
|
0
|
3
|
3204
|
|
POST
|
Goes to show how little I know! Thanks for clarifying and even offering equivalent options. That helps me understand what's happening. But... no matter which of the 3 options I use for that line, I get the same error: Traceback (most recent call last): File "<string>", line 1, in <module> RuntimeError: 'in_table' is not a table or a featureclass If I remove the comma, that error goes away but then I get the "setSelectionSet" error mentioned above.
... View more
11-08-2018
09:15 AM
|
0
|
5
|
3204
|
|
POST
|
Joshua, Thank you again for helping me. This should be a slick alternative to running a SQL query. I noticed an accidental (?) comma after tv on line 6, which I fixed. But then I got a different error: Traceback (most recent call last): File "<string>", line 4, in <module> (this is line 9 in your post above) AttributeError: 'Result' object has no attribute 'setSelectionSet' My only thought on this is setSelectionSet can only be run on a layer, not on a table view? I don't know why that would be. I'm sorry my Python skills aren't (yet) strong enough to troubleshoot this. Thanks, Jeff
... View more
11-08-2018
08:22 AM
|
0
|
7
|
3204
|
|
POST
|
Joshua, I've returned to this issue lately; it's kind of the opposite approach to a project that led to another thread I've started (Show distinct tuples regardless of column order). Xander's script does exactly what I need, but it's quite slow as you've noted. I was trying to use your script, as I understand it's much more efficient, but it doesn't return spatial result. While the graph of max possible features is interesting, I need to show a map of one possible outcome (any outcome is fine) of randomly selected parcels meeting the minimum spacing. Is it possible to output a map-able result from your script? Or, alter the logic used in your script to create an output like Xander's? I continue to look at the data made by the "rel" and "buff" variables in your script, seeing if there's something I can map. Thank you!
... View more
11-05-2018
09:30 AM
|
0
|
1
|
793
|
|
POST
|
To answer my own question, here's the ArcPy and SQL to eliminate the "a-b" "b-a" pairs: sde = r'sdeconnectionfile.sde'
sde_conn = arcpy.ArcSDESQLExecute(sde)
sql = """SELECT t1.IN_FID, t1.NEAR_FID, t1.NEAR_DIST
FROM sdeowner.NEARTABLE t1
EXCEPT
SELECT t1.IN_FID, t1.NEAR_FID, t1.NEAR_DIST
FROM sdeowner.NEARTABLE t1
INNER JOIN sdeowner.NEARTABLE t2
ON t1.IN_FID = t2.NEAR_FID
AND t1.NEAR_FID = t2.IN_FID
AND t1.IN_FID > t1.NEAR_FID"""
sde_conn.execute(sql) Note that NEARTABLE is the same table every time; I'm inner joining it to itself. Also note that this is on SQL Server; other DBMSs may require different SQL. Now, this results in an ugly list of IN_FIDs, NEAR_FIDs, and NEAR_DISTs in the Python window. All I care about is getting the average of NEAR_DIST, hence why I've gone to all this trouble to eliminate the a-b, b-a pairs which would affect the result. That can be done with this SQL: SELECT AVG(t3.NEAR_DIST)
FROM
(SELECT t1.IN_FID, t1.NEAR_FID, t1.NEAR_DIST
FROM sdeowner.NEARTABLE t1
EXCEPT
SELECT t1.IN_FID, t1.NEAR_FID, t1.NEAR_DIST
FROM sdeowner.NEARTABLE t1
INNER JOIN sdeowner.NEARTABLE t2
ON t1.IN_FID = t2.NEAR_FID
AND t1.NEAR_FID = t2.IN_FID
AND t1.IN_FID > t1.NEAR_FID) t3
... View more
11-02-2018
10:59 AM
|
1
|
9
|
3204
|
|
POST
|
I just added a corresponding request to ArcGIS ideas: Option to eliminate pairs from Generate Near Table But in the meantime, I'm wondering if anyone can help me figure out how to find duplicate pairs of attribute values from separate columns, regardless of column order, by way of SQL and/or ArcPy. The problem (described in the ArcGIS Idea above) is that the Generate Near Table tool creates pairs of distance values that are identical, as uniquely identified by the pairing of IN_FID and NEAR_FID attributes. That is, the unique distance between FID "a" and FID "b" occurs twice: "a-b" and "b-a" in the IN_FID and NEAR_FID columns, respectively. I only want one value from that pair, otherwise it affects statistics like the count and average of distances. I've found that it is possible to find these pairs with SQL: mysql - Show distinct tuples regardless of column order - Stack Overflow (I stole this question title for my post, obviously ) But of course, you can't easily break out of the WHERE clause in ArcGIS. Maybe this is possible in ArcPy, but I'm not sure how to adapt that SQL to work in ArcPy. If anyone could help me with that, it would be a boon to doing not just this specific SQL query but how to do any advanced SQL query in ArcPy (or other methods?) that's not otherwise possible within ArcGIS. Note: the near tables I've created are in a file GDB, but I do have the option of putting them in SDE if that helps. I do not, however, have the option of accessing SDE outside of ArcGIS, e.g., through SQL Server Management Studio. I'd like to learn how to do advanced SQL queries (that is, SQL involving more than just WHERE on a single layer) in ArcGIS regardless of data source. If it's possible at all. Thank you!
... View more
10-31-2018
12:10 PM
|
0
|
10
|
3889
|
| Title | Kudos | Posted |
|---|---|---|
| 4 | 09-09-2024 12:05 PM | |
| 2 | 11-20-2019 07:41 AM | |
| 1 | 06-20-2024 07:43 AM | |
| 1 | 07-13-2022 09:50 AM | |
| 1 | 12-11-2023 06:12 AM |
| Online Status |
Offline
|
| Date Last Visited |
Sunday
|