POST
|
Figured it out after several frustrating weeks! After a while, too much documentation is as bad as not enough... Had to use the FeatureLayerCollection class from the arcgis Features module. Then used the manager helper object to overwrite my existing hosted table. # this allows me to access the manager helper object to overwrite my currently existing hosted table (commRecTable)
from arcgis.features import FeatureLayerCollection
commRec_collection = FeatureLayerCollection.fromitem(commRecTable)
# This uses the manager helper object to overwrite my existing hosted table with the new CSV my script outputed (commRecCSV)
commRec_collection.manager.overwrite(commRecCSV)
... View more
09-09-2019
09:51 AM
|
3
|
6
|
5519
|
POST
|
Mine appeared to be if Jupyter Notebook was running and accessing the document, this problem would happen if the code failed to run, like it wasn't releasing the lock on the document. I'd have to close down Jupyter & all of it's processes before it'd fix the problem.
... View more
09-09-2019
09:45 AM
|
0
|
0
|
2649
|
POST
|
I have been attempting to automate a process where I normally download CSVs from several different places, & manually overwrite the hosted tables in AGOL. I'd like to automate this all in a script that I can schedule to run on a nightly basis. (As background, the data feeds several metrics dashboards viewed by Admin.) I have yet to get the hosted table to update in AGOL. 1. Download updated CSV & Upload to Pandas dataframe 2. remove null rows & format date columns. 3. Export dataframe to new CSV. 4. Update hosted table in AGOL with new CSV. When I view the hosted table, there are two different updated dates showing. Picture attached. The first shows the date I ran the script (today), but the second shows the date I manually overwrote / updated the table (yesterday). I had been following https://community.esri.com/thread/183390-arcgis-online-service-overwrite-using-python-api below is what I have been using to update. palTable = gis.content.get('28b7f819dce24647aebad88d04ff3815') #This ets the hosted table in AGOL
palCSV = gis.content.get('65f1e32cda224199b6ec10c4139c2f1a') #This gets the CSV in AGOL
palCSV.update({}, data=newCSV) #This updates the CSV on AGOL
palTable.update({}, data=newCSV) #This updates the hosted table on AGOL Update the CSV & re downloading the file shows that it correctly updated itself. Viewing the data on the hosted table shows that it has not updated itself. Is there a way to "refresh" the table or a better syntax? Thanks!
... View more
08-01-2019
08:55 AM
|
1
|
10
|
6904
|
POST
|
I have several excel & CSV documents loaded into AGOL WITH MY TIME ZONE SET that are consumed in dashboards. It is all fine and dandy for the first time I upload the document. However, when I overwrite the documents with the updated data, I lose my timezone and AGOL defaults it to UTC without the ability to change it. (Note: I am doing this manually, although I'd like to create some Jupyter Notebooks to read the data from my spreadsheets and publish to AGOL, but I have not had the time to accomplish this yet.) I have tried overwriting both the file itself and the hosted table created from uploading it - and both methods result in my not being able to specify the timezone for the newly uploaded data. I would think that it would keep the time zone I set with the initial creation of the hosted table. At this point, I feel like my only option would be to upload a new document, change the data source in all of my dashboard widgets, and delete the old source, which sounds preposterous and like a lot of unnecessary work. Any ideas?
... View more
06-18-2019
12:21 PM
|
0
|
0
|
293
|
POST
|
Thank you for all of your work helping me on this. I greatly appreciate it.
... View more
06-18-2019
09:52 AM
|
0
|
0
|
1863
|
POST
|
Thank you for the suggestions. I will look into adapting my script!
... View more
06-18-2019
09:52 AM
|
0
|
0
|
1863
|
POST
|
I have the field set to None, that is how I was able to fix the problem I was having similar to Elizabeth's post. I will put together a map package. thanks.
... View more
05-30-2019
08:26 AM
|
0
|
1
|
1863
|
POST
|
Jeff: I'm not sure if you're responding to me or Elizabeth. I created a similiar post to her's here https://community.esri.com/thread/234564-exportingtopdf-python-for-map-series Thanks,
... View more
05-30-2019
07:57 AM
|
0
|
1
|
2879
|
POST
|
I shutdown my computer for 1 minute and restarted and was able to access my Pro documents. Not a great fix but I didn't want to keep making new documents.
... View more
05-30-2019
07:41 AM
|
1
|
1
|
4084
|
POST
|
I am attempting to export a range of sheets in a map series in ArcPro. I'm basing my code off ESRI's code sample 2 here https://pro.arcgis.com/en/pro-app/arcpy/mapping/mapseries-class.htm. import arcpy, os, sys
relpath = r"S:\Tax Services\Tax Maps"
aprx = arcpy.mp.ArcGISProject(r"S:\FC GIS\GIS Projects\New Tax Maps\Tax Map DDP\Tax Map DDP - new.aprx")
l = p.listLayouts()[1]
if not l.mapSeries is None:
ms = l.mapSeries
if ms.enabled:
for pageNum in range(1, 5):
ms.currentPageNumber = pageNum
print("Exporting {0}".format(ms.pageRow.Page))
pageName = ms.pageRow.Page
l.exportToPDF(relpath + "MapSheet_{0}".format(ms.pageRow.page) + ".pdf") However, I keep getting the following error: ---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-3-2671737b67ee> in <module>()
9 for pageNum in range(1, 5):
10 ms.currentPageNumber = pageNum
---> 11 print("Exporting {0}".format(ms.pageRow.Page))
12 pageName = ms.pageRow.Page
13 l.exportToPDF(relpath + "MapSheet_{0}".format(ms.pageRow.Page) + ".pdf")
C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\_mp.py in pageRow(self)
2240 @property
2241 def pageRow(self):
-> 2242 return self.convert(convertArcObjectToPythonObject(getattr(self._arc_object, "pageRow")))
2243
2244
C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\_mp.py in convert(self, dictionary)
2236 def convert(self, dictionary):
2237 from collections import namedtuple
-> 2238 return namedtuple('pageRow', dictionary.keys())(**dictionary)
2239
2240 @property
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\collections\__init__.py in namedtuple(typename, field_names, verbose, rename, module)
399 if not name.isidentifier():
400 raise ValueError('Type names and field names must be valid '
--> 401 'identifiers: %r' % name)
402 if _iskeyword(name):
403 raise ValueError('Type names and field names cannot be a '
ValueError: Type names and field names must be valid identifiers: 'Shape.STArea()' Any help would be appreciated!
... View more
05-30-2019
07:21 AM
|
0
|
7
|
2319
|
POST
|
Elizabeth: I did get the page number section to work based on your comments, so thank you! I'm actually now trying to export a range based off of the same ESRI sample. I keep getting the error on accessing the row attribute, where it says ValueError: Type names and field names must be valid identifiers: 'Shape.STArea()'
frustrating!
... View more
05-30-2019
07:12 AM
|
0
|
3
|
2879
|
POST
|
I just started having this issue. Map Projects I created for exporting large Map Series are now opening as Read - Only. I created this project in ArcPro about 2 months ago, and it is now doing this. Any headway?
... View more
05-28-2019
12:32 PM
|
0
|
3
|
4084
|
POST
|
I ended up going through and redoing every sharing setting for every data layer, dashboard, and application for this group, and it seems to have resolved my issue. It seemed that even though the settings appeared to be set correctly, one was holding onto a previous setting. Hope this helps...
... View more
05-28-2019
11:10 AM
|
4
|
0
|
2391
|
POST
|
Hello: I am also having this issue. I think it has something to do with my Page Numbers being a combination of letters and numbers. Were you able to resolve this issue?
... View more
05-28-2019
11:05 AM
|
0
|
5
|
2879
|
Title | Kudos | Posted |
---|---|---|
2 | 12-03-2020 11:57 AM | |
1 | 04-19-2023 12:42 PM | |
1 | 12-15-2022 09:06 AM | |
4 | 07-24-2023 06:24 AM | |
1 | 07-18-2023 01:42 PM |
Online Status |
Offline
|
Date Last Visited |
03-11-2024
11:10 AM
|