|
POST
|
Hi David Sorry it is a bit vague to say "I overwrote the arcgis related packages under anaconda3 using the packages under ArcGIS pro", and even myself is a little confused when looking at this statement now.I had to find my note for that period of time to help me to recall the stuff I was talking about. I'll try my best to explain... Firstly, I am surprised that people are still having this issue --- I thought it was solved long time ago. At that time, the latest API version was 2.3.1, and the latest Python was 3.6 Secondly, the motivation for me to replace the arcgis package in Anaconda is that the arcgis python environment was working in Pro 2.0 at that moment. By the way, Anaconda version much less a problem than the arcgis package version itself. Thirdly, Python interpreter version matters in this case. I tried out that Python 3.5.x was the working version for the Python API for ArcGIS 1.0.1. And Python 3.6 didn't work. Last but not least, I didn't want to lose the advanced functionalities in the Python API for ArcGIS 2.x as a result of replacing it with lower version installed with ArcGIS Pro 2.0, I used an alternative approach to change the source code in the latest Python API version 2.3.1 to make it working. Here are the relevant notes from my old notebook, kind of fun for me to read these paper notes (nostalgia). Sorry for the scribbles --- they were only meant to be quick reminders for myself really, and without those notes I will never remember what I did 11 months ago . Cause: Solution: Python 3.6 issue: Follow up and some thought
... View more
08-13-2018
07:57 PM
|
2
|
0
|
4547
|
|
POST
|
Thanks Joshua. I've tried that but no success. Please have a look at the screenshot.
... View more
08-12-2018
11:43 PM
|
0
|
5
|
4159
|
|
POST
|
That makes sense. I remember someone reported the similar issue when publishing a custom Geoprocessing to the server. But my case is really about sharing a project with other team mates, all the tools are designed to run on the local machine rather than run as a web service. After they download it (or open it from portal/ArcGIS Online directly), the project folder structure are guaranteed and all the references to the datasource and Online resources should be ready to use. Thanks
... View more
08-12-2018
09:59 PM
|
0
|
2
|
6462
|
|
POST
|
I am pretty sure all the workspaces I use in the project are all under the same project folder. The absolute path pointing to "..\\users\\simoxu...." were added in the front of my code by ArcGIS Pro Package Project tool / function, I am quite puzzled by this behavior. Because it is pointing to "C:\Users\<USERPROFILE>\AppData\Local\ESRI\ArcGISPro\Staging\SharingProcesses/..." and this folder seems related to the sharing activity, I'll see whether or not this behavior has anything to do with caching.
... View more
08-12-2018
09:49 PM
|
0
|
0
|
6462
|
|
POST
|
Thanks Dan. That's the problem --- ESRI-added variable points to my folder which no one else can access. My question is, why does the Package Project tool do this? it seems the tool is confused by my code, somehow. I understand the Package Project tool will analyze my custom tool before consolidating the required resources, so I manually used the Analyze Tools for Pro to analyze my script, and there are no related issues reported in result. As you can see in my code, I am creating a path using os.path.join() function, the second parameter is a string (folder name) which is replaced by an ESRI-added variable ---- what? I am using a string, a CONSTANT, why changed it to a variable?
... View more
08-12-2018
06:06 PM
|
0
|
2
|
6462
|
|
POST
|
It's a surprise to me that ArcGIS Pro changes the python code in my script tool when I pack the project and upload the ppkx to ArcGIS Online. Here is the first a few lines of code for one script tool in the unpacked ppkx, please pay attention to the codes between "Esri start of added imports" and "Esri end of added variables" # Esri start of added imports
import sys, os, arcpy
# Esri end of added imports
# Esri start of added variables
g_ESRI_variable_1 = "EventID = '{}'"
g_ESRI_variable_2 = os.path.join(arcpy.env.scriptWorkspace,'..\\..\\..\\Users\\simoxu
\\AppData\\Local\\Esri\\ArcGISPro\\Staging\\SharingProcesses\\0038
\\RDA Tools for ArcGIS Pro\\p20\\current_checkout_attachments')
# Esri end of added variables
#-------------------------------------------------------------------------------
# Name: rda_checkout
# Purpose: checkout the assessment for a specific event and map it
#
# Author: simoxu
# Created: 27/07/2018
#-------------------------------------------------------------------------------
from arcpy import da
import os,sys
import shutil
In one place in my original code, I have the following line: checkout_image_path= os.path.join(homefolder,"current_checkout_attachments") But it was replaced with the following code, which is causing fatal error for the tool itself. checkout_image_path= os.path.join(homefolder,g_ESRI_variable_2) It's quite strange that ArcGIS Pro packaging tool will change my code without informing me --- I only found out this when I shared the project package with others and then was told the tools could not run properly. Is it only me? Any advice? I am using ArcGIS Pro 2.2.1, by the way. Thanks.
... View more
08-10-2018
12:09 AM
|
2
|
13
|
9176
|
|
POST
|
Thanks Dan. I am concerned that the temporary layer will mess up one of my maps. If I have an active map this will be my active map otherwise this will be first map in my map list (I guess...) Although I can delete the records in the temp layer, but I assume the layer itself will still be listed in the content pane. The point is, in my case I don't have a need to visualize this intermediate layer/table. Hope this make sense.
... View more
08-09-2018
11:36 PM
|
0
|
0
|
4159
|
|
POST
|
arcpy.env.addOutputsToMap=False
arcpy.MakeTableView_management("<workspace>\\RDA.DBO.Immediate_Assessment",
"tmp_tbl",where_clause)
# <Result 'tmp_tbl'>
arcpy.GetCount_management('tmp_tbl')
# File "<string>", line 1, in <module>
# File "c:\program files\arcgis\pro\Resources\arcpy\arcpy\management.py", line 17492, in GetCount
# raise e
# File "c:\program files\arcgis\pro\Resources\arcpy\arcpy\management.py", line 17489, in GetCount
# retval = convertArcObjectToPythonObject(gp.GetCount_management(*gp_fixargs((in_rows,), True)))
# File "c:\program files\arcgis\pro\Resources\arcpy\arcpy\geoprocessing\_base.py", line 496, in <lambda>
# return lambda *args: val(*gp_fixargs(args, True))
# Error in sys.excepthook:
# Traceback (most recent call last):
# File "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\Extensions\Microsoft\Python\Core\ptvsd\debugger.py", line 2409, in _excepthook
# print_exception(exc_type, exc_value, exc_tb)
# File "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\Extensions\Microsoft\Python\Core\ptvsd\debugger.py", line 2656, in print_exception
# sys.stdout.write(out)
# AttributeError: 'NoneType' object has no attribute 'write'
#
# Original exception was:
# Traceback (most recent call last):
# File "<string>", line 1, in <module>
# File "c:\program files\arcgis\pro\Resources\arcpy\arcpy\management.py", line 17492, in GetCount
# raise e
# File "c:\program files\arcgis\pro\Resources\arcpy\arcpy\management.py", line 17489, in GetCount
# retval = convertArcObjectToPythonObject(gp.GetCount_management(*gp_fixargs((in_rows,), True)))
# File "c:\program files\arcgis\pro\Resources\arcpy\arcpy\geoprocessing\_base.py", line 496, in <lambda>
# return lambda *args: val(*gp_fixargs(args, True))
# arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid.
# ERROR 000732: Input Rows: Dataset tmp_tbl does not exist or is not supported
# Failed to execute (GetCount).
If the arcpy.env.addOutputsToMap is set to True, the same code will work. arcpy.env.addOutputsToMap=True
arcpy.MakeTableView_management("<workspace>\\RDA.DBO.Immediate_Assessment",
"tmp_tbl",where_clause)
arcpy.GetCount_management('tmp_tbl')
# <Result '45'> What I really want to do is the same as the Python following example, but I don't want to add the temporary layer to the map (the code should not rely on an active map in my case) # Name: DeleteFeatures_Example2.py
# Description: Delete features from a feature class based on an expression
# Import system modules
import arcpy
# Set environment settings
arcpy.env.workspace = "C:/data/airport.gdb"
# Set local variables
inFeatures = "parcels"
outFeatures = "C:/output/output.gdb/new_parcels"
tempLayer = "parcelsLayer"
expression = arcpy.AddFieldDelimiters(tempLayer, "PARCEL_ID") + " = 'Cemetery'"
# Execute CopyFeatures to make a new copy of the feature class
arcpy.CopyFeatures_management(inFeatures, outFeatures)
# Execute MakeFeatureLayer
arcpy.MakeFeatureLayer_management(outFeatures, tempLayer)
# Execute SelectLayerByAttribute to determine which features to delete
arcpy.SelectLayerByAttribute_management(tempLayer, "NEW_SELECTION",
expression)
# Execute GetCount and if some features have been selected, then
# execute DeleteFeatures to remove the selected features.
if int(arcpy.GetCount_management(tempLayer)[0]) > 0:
arcpy.DeleteFeatures_management(tempLayer) the above code is from ESRI help document: Delete Features—Data Management toolbox | ArcGIS Desktop So the question is: Can we make in-memory feature layers or tables without adding them to a map?
... View more
08-02-2018
12:04 AM
|
0
|
14
|
6513
|
|
POST
|
Just dump my latest thought here: If it is really by design to seperate ArcPy from ArcGIS Pro applicaiton, so that your python scripts won't rely on the Pro application too much, that's fine. If Arcpy is not designed to access Pro function, it's OK, but, should the map view (ArcGIS Pro component) be allowed to fully refreshed when the map is changed by ArcPy? currently it will be refreshed when you add a new layer or make some changes on the existing layers, but it won't update the camera . I think multiple map view is complicating the situation: each map view has its own camera which is independent from the default camera as well as each other. Why do you need multiple views? The only reason I can think of is to accommodate the 3D map needs. for 2D maps, multiple view are not really that much needed if you can't have different layer visibility is in different map views. So I guess there are some comprises made in functionalities to accommodate 2D and 3D in one application, not very sure though. if it's true, the problem is very deeply rooted and won't be fixed easily and quickly.
... View more
07-19-2018
07:47 PM
|
0
|
0
|
1637
|
|
POST
|
Yes, that was exactly what I did following the instruction. I used my own windows credential to create the print service and it worked. but the problem is I have to change my passwords periodically, as a result, I have to recreate the service every time when I change my password. Not a perfect solution. The question remains to today, what's wrong with the default "arcgisserver" account? what permission is it missing or what permission does it need to make the print service working? we asked the ICT to create the arcgisserver account when we were about to install the arcgis servers and portal, all permissions were set according to ESRI document. the arcgisserver account were supposed to be used by services....
... View more
07-18-2018
07:33 PM
|
0
|
0
|
9677
|
|
POST
|
The Feature Service is "internal", I mean it's only visible inside of the corporate network, but the Print Service is also hosted in the intranet and on the same Federated ArcGIS Servers. And I specified the print service in the print widget in Web Appbuilder, so what's set in the utility service in the portal does not matter. I ended up creating a print service using my own windows credential, that kind of worked but not without annoying side effects.
... View more
07-18-2018
07:22 PM
|
0
|
0
|
9677
|
|
POST
|
I can endure the context sensitive banners in Pro, although I am always suspicious how intelligent the banners are... But there are one particular thing that I found hard to bear: there's no access to the map view using ArcPy! We are told "Arcpy.mp was built for the professional GIS analyst and for developers", but it's a joke not giving users access to the map view via python. how on earth can developers and analyst represent the result using code in ArcGIS Pro? Using the MapFrame in the layout is not an option --- too weird. I like the project concept, but can't comprehend the new concept of "map + multiple map views". ArcGIS Pro architect should explain why one map can have multiple views when these views can't even have different layer visibilities?! serious? Isn't map is a view of data by common sense? Maps, Map Views and Layouts in ArcGIS Pro If you agree this is a serious issue, please let our voice heard by voting this ArcGIS Idea. Allow arcpy.mp to change the map extent in ArcGIS Pro If they can't make ArcMap a 64-bit application compatible with python 3, sooner or later we all have to migrate to ArcGIS Pro. We can only hope ESRI can get it right before encouraging everyone to move over. Get the basic right at least.
... View more
07-17-2018
11:18 PM
|
1
|
0
|
3707
|
|
POST
|
Is it reasonable to separate Map View from Map in ArcGIS Pro? Why do you need multiple views for a map? in my mind, a map is literally a VIEW! The concept of Map View in ArcGIS Pro is causing confustion, not only among users, also seems among ArcGIS Pro development team themselves. The following are from my Python experience in ArcGIS Pro. Firstly, MapView class in the arcpy.mp seems have nothing to do with the Map View we interact in ArcGIS Pro. in its help MapView—ArcPy | ArcGIS Desktop "Used in conjunction with ConvertWebMapToArcGISProject in a web map printing web tool to access a map view to print or export. Provides access to a map view in order to print or export a web map that doesn't contain page layout surroundings (for example, title, legends, and scale bar)." You see, MapView class is designed to facilitate printing, not Map View interface with Python code. Secondly, there's no way to access the Map View using ArcPy. In ArcGIS Pro help: Map—ArcPy | ArcGIS Desktop "The only way to visualize the contents of a Map is in either a map view, that is, as a tab in the application with its own table of contents, or in a map frame on a page layout." "Note: arcpy.mp does not provide access to map views within the application; it only provides access to MapFrames." This is devastating: as a developer, most of the time I work with the map views not the layout ! ! This makes ArcGIS Pro and all the benefits it has as a ideal python environment having ArcPy and Python API for ArcGIS in one place, useless. At least for me, for now. And I will not recommend my peer developers to migrate their python project from ArcGIS desktop (ArcMap, ArcCatalog) to ArcGIS Pro without knowing its maturity status, despite it seems the ultimate environment to work across cloud and on-premise GIS platforms. I created an ArcGIS Idea related to this topic, please vote it up if you agree with me. Allow arcpy.mp to change the map extent in ArcGIS Pro The above ArcGIS Idea was created before I created this discussion, it's more specific: If there have to be Map Views in ArcGIS Pro, we need means to access the map view to navigate the map in it programmatically.
... View more
07-05-2018
08:18 PM
|
2
|
1
|
2836
|
|
POST
|
I've created a ArcGIS Idea for this function to be considered by ESRI. Please vote it up. https://community.esri.com/ideas/15227
... View more
07-03-2018
09:44 PM
|
5
|
0
|
7731
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 02-28-2019 05:13 PM | |
| 1 | 02-25-2019 04:54 PM | |
| 1 | 03-05-2019 02:08 PM | |
| 1 | 03-12-2019 10:20 PM | |
| 1 | 11-27-2024 04:36 AM |
| Online Status |
Offline
|
| Date Last Visited |
01-17-2025
07:39 AM
|