POST
|
Is there a way to "save as" a project from ArcPy? I know there's "save" and "saveACopy" but not "saveAs". I'm trying to establish a workflow where I open a template project, customize it by running a script, then save it as a new project (and further customize it manually) without having to close the template and then open the copied project. I can "save as" manually, but not with ArcPy?
... View more
06-30-2021
08:15 AM
|
0
|
7
|
1193
|
POST
|
I'm trying to create a custom pop up that includes attributes from multiple layers. Based on this example, it seems like FeatureSets should be the way to do this. The problem is this requires a geometry evaluation; e.g., return any features from layer B that intersect the feature I selected on layer A. This is overly complex; all I want returned are the features (if any) from layer A or B located exactly where I clicked - plain old popup behavior. I looked at all the geometry functions available but none of them seem to emulate a simple click. Is there a completely different way to accomplish this? Thanks!
... View more
06-18-2021
12:47 PM
|
4
|
4
|
2777
|
IDEA
|
It would be great if rectangle (and polygon, circle, ellipse) layout text elements had fitting strategies like map labels. Legends already have some control for columns and text size. The idea is for all these elements to have additional fitting strategies like abbreviations and font width compression. This would help tremendously with ensuring layouts work for all pages of a map series with dynamic text of varying lengths. This idea would help with fitting text in a single element, but a closely related idea of mine would help prevent overlap or clipping between multiple layout elements in a layout used for map series: Intelligent grouping (flow) for layout elements
... View more
06-15-2021
10:35 AM
|
7
|
3
|
806
|
POST
|
Hi, @JeffBarrette. I was thinking about adding "rectangle text fitting strategy" as an idea, but it sounds like this is already on Esri's radar. Do you know when this might be available? It would be really cool if text fitting strategies for legends and other layout text boxes included options like abbreviations and font width compression (as is already possible for map labels). This is closely related to an idea I posted about a year ago that hasn't gotten much attention: Intelligent grouping (flow) for layout elements Thanks!
... View more
06-15-2021
10:02 AM
|
0
|
1
|
881
|
POST
|
I'm wondering what determines whether you can change version or refresh a data source in a map view. In one of my map views, I can refresh the data source of one SDE database connection but not another. Both databases are stored on the same SQL Server. I have read-only access to the one I can refresh, while I have write access (to FCs I own) to the database I can't refresh. I don't know if read/write access has anything to do with it, but if anything it seems backward of what I would expect. I can refresh both databases from the Catalog view, just not the map view. Regardless, I have to restart Pro to see changes made outside the project. This is related to another question I'm still working on: Joined table edits not showing on map. I'm wondering if not being able to refresh that database is related to the fact that I can't get edits to a joined table in the same db to show up in that map view until after restarting Pro.
... View more
05-26-2021
07:14 AM
|
1
|
0
|
626
|
POST
|
Can't have everything, I guess. Thanks for your help. Even if I still have to do some manual steps to output my maps, using the linked map frame extent is still superior to the way I was doing it before.
... View more
05-17-2021
11:36 AM
|
1
|
0
|
1680
|
POST
|
I've played around with this a bit and it's close but not quite. In your example of states (my "A, B" features) and counties (my "1, 2" index features), you are not filtering to show just the subject state, which is what I need. Pro clearly knows what feature A is, because it's able to zoom to its extent based on index feature 1, but I can't get a page query to work on feature A. It either shows all of A, B (query off) or none of A, B (query on). I tried every combination of page queries on layer A, B between the two map frames. There are a couple other minor issues, but that's most because of my data. I would figure out how to work around that if could figure out how to make page queries work on features A, B. So close! Thank you for your help.
... View more
05-17-2021
09:33 AM
|
0
|
0
|
1686
|
POST
|
Thanks for your quick reply, @AubriKinghorn. This looks very promising! I'll give it a shot and report back. It's great that this option would retain my project as a "real" map series that can be seen in Pro. Whereas the Python option (as I'm envisioning it) would mean the resulting map pages only exist as exported PDFs.
... View more
05-14-2021
12:07 PM
|
0
|
0
|
1736
|
POST
|
I'm trying to create a map series where the extent of each map is based on features other than the series' index layer. E.g., index feature 1 is within feature A, and I need the map extent to cover the entirety of feature A. Index feature 2 is within feature B, etc. The problem is map series extent isn't designed for such a scenario. I'm trying to brainstorm a workaround. I could use features A, B... as the index layer, but then I'm not sure how I'd create a page query to get the corresponding feature 1, 2... There is not a 1-to-1 ratio of features A, B to 1, 2. Feature A might contain features 1, 2, 3, 4 and I need a map page for each feature 1, 2, 3, 4. Plus, there are dynamic text elements in the layout driven by features 1,2..., so that really wouldn't work. It's probably possible to do this with Python, but I'm not entirely sure how. I'm thinking it would be a For loop, looking for the index features (1, 2, 3) and an attribute of each feature would be used use to select the corresponding feature A, B, C. Could also use a spatial selection. Has anyone else attempted something similar? Would this even be handled like a map series in Python? I'm thinking probably not. Should this be an idea suggestion for a future version of map series in Pro? Thanks for reading my ramble!
... View more
05-14-2021
11:08 AM
|
0
|
5
|
1773
|
POST
|
I did not realize until just now that those 2 options existed! I was using the Table Attribute Value, but for my situation the Map Series Attribute is exactly what I need. Learn something new every day! Thanks!
... View more
04-22-2021
01:03 PM
|
0
|
0
|
899
|
POST
|
I'm using dynamic text to put the page name on each layout page of a map series. The page name is a street address and is not necessarily unique from other page names. I'm also using dynamic text to insert a table attribute for the corresponding features. (Even if a street address is repeated, this other attribute is not.) I just discovered that if a page has a non-unique name/street address, the dynamic text will insert every corresponding value found in the table attribute, which is bad. I'm wondering if this is a bug or an expected behavior. Ideally the page names would be unique, but I didn't think it was a requirement until now. Just trying to assess the situation before I figure out a workaround. Thanks! Example: I add a feature with an address 123 Maple St and it has a corresponding table value of "foo". Later, another feature is added at 123 Maple St with table value "bar". Now, if I open the layout for either page, the dynamic text displays "foo bar".
... View more
04-22-2021
12:00 PM
|
0
|
2
|
913
|
POST
|
Ah! MS vs. Layout also explains why the code complete wasn't working. You were of course right about removing the single quotes from the field name. I thought they were required if using a file GDB, but apparently not. A lot of trial and error went into formatting the SQL statement properly for Python, and that was what I finally arrived at that didn't create an error. However, it also didn't create a selection! Thanks again!
... View more
04-22-2021
11:30 AM
|
0
|
1
|
492
|
POST
|
I'm trying to actually implement the knowledge this morning I got from this thread yesterday. I'm getting an error when I try to run my script. I can't figure out what I've done wrong. import arcpy, os, sys
aprx = arcpy.mp.ArcGISProject('CURRENT')
HPCcase = aprx.listLayouts('HPC Case Layout')[0]
ms = HPCcase.mapSeries
if ms.enabled:
ms = HPCcase.mapSeries
indexLyr = ms.indexLayer
PDFpath = 'V:\\projects\\DevSvcs\\Planning\\HistoricDistrict\\HPC\\'
HPCdate = '20210513'
arcpy.management.SelectLayerByAttribute(in_layer_or_view=indexLyr,
selection_type="NEW_SELECTION",
where_clause=f"'HPCDate'='2021-05-13'")
pageName = ms.pageRow.ConcatAddr
HPCcase.exportToPDF(out_pdf=os.path.join(PDFpath, HPCdate, f"HPC_{HPCdate}_{pageName}.pdf"),
page_range_type="SELECTED",
multiple_files="PDF_MULTIPLE_FILES_PAGE_NAME",
resolution=300) Traceback (most recent call last):
File "<string>", line 19, in <module>
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\utils.py", line 191, in fn_
return fn(*args, **kw)
TypeError: exportToPDF() got an unexpected keyword argument 'page_range_type' In addition to the export error, I'm pretty sure nothing is getting selected in my index layer. Since a date is the selecting criterion, it's an additional syntax hurdle to make sure I'm doing it exactly right. When I create the features, I only care about the date, not the time. (Time should always be 00:00:00, but I'd rather it not be a factor just in case.) Also, I want to make sure I understand how the selected page range works for exporting in Python. Does it only work by selecting index features also in Python? Is it possible to select one or more pages manually in the Contents pane, then export with Python without further specifying a selection? Thanks!
... View more
04-22-2021
08:10 AM
|
0
|
0
|
2351
|
POST
|
Thank you, @JeffBarrette and @DanPatterson. I'm realizing a few good nuggets of information from your responses. What I called a loop in my o.p. is not a loop; it's a conditional. You don't have to specify every single parameter for the method (but you can, as long as you follow the specified order); you just need to specify the name of the parameter(s) you want. Booleans are like integers, no quotes. A few outstanding questions: Why are the page_range parameters not included in the full, non-named parameter array for the method? Are there other (hidden) parameters? Is it common to have additional parameters that can only be called by name? Thanks!
... View more
04-21-2021
03:29 PM
|
0
|
1
|
2385
|
POST
|
Unfortunately, the bus routes would need to geometrically match the streets exactly. There may be some ways to get them to align, but in the end it's probably no quicker or easier than doing it manually, sorry! I'm still not entirely sure what you're trying to do. Assign street names to bus routes? So that only those street names are labeled? One last idea. You did mention you envision "clipping" the street data. You might be able to do that. Create as thin of a buffer on your bus routes as you can to get the traversed streets in their entirety. Clip the streets and export them as a new feature class. This will still include very short segments of cross streets, but you can set a minimum feature length for labeling, which hopefully would result in a pretty clean selection of streets that actually have bus routes.
... View more
04-21-2021
10:36 AM
|
1
|
2
|
1193
|
Title | Kudos | Posted |
---|---|---|
1 | 07-13-2022 09:50 AM | |
1 | 12-11-2023 06:12 AM | |
1 | 07-05-2023 06:04 PM | |
1 | 05-12-2023 06:44 AM | |
3 | 01-10-2023 05:19 AM |
Online Status |
Online
|
Date Last Visited |
3 hours ago
|