POST
|
Just do it! Today, I finally went through my migrated blog posts and updated them. With perhaps one exception, all showed errors, and I just went though the process of verifying them. I've been putting it off for some time, but I finally got my nose to the grindstone for just a few hours. The lack of appropriate search filters didn't help. The day before I spent a surprising amount of time just trying to find all my blog posts in the first place.
... View more
09-25-202108:10 PM
|
0
|
1
|
525
|
BLOG
|
Some time ago I posted an article comparing the performance of older Esri SDKs (ArcObjects: .NET, C++) with newer ones (Pro, Enterprise, Runtime: .NET). The Pro and Exterprise SDKs barely performed better than their ArcObjects .NET counterparts: instead of being re-engineered from scratch, they obviously leveraged the older ArcObjects technology, and were bogged down by the same COM interop performance issues. Runtime, on the other hand, proved to be a true innovation and far outperformed any of the other SDKs. As a fun exercise, I decided to compare the three flavors of Runtime 100.12 available for Windows desktop (.NET, Java, Qt). Again, I used the same purely computational benchmark: creating convex hulls for 100,000 random polygons. I built all three examples as standalone console applications (release builds), and executed them outside of their respective IDEs. I ran each benchmark five times, and picked the best time for each. Here's the benchmark comparison: Runtime SDK Execution time (seconds) .NET 16 Java 19 Qt (C++) 33 And here's the normalized performance index: I expected .NET and Java to be pretty much neck-and-neck, since no COM interop is involved in the benchmark (COM interop perfomance is much worse in Java than .NET). Qt was a bit of a surprise; although, I've dabbled with Runtime for Qt in the past, and noticed that fine-grained code seems not to be as fast as it could be. While C++ is my favorite programming language, and I admire Qt's "write once, deploy many" approach, it's obvious that the framework carries some baggage. [See attachment for the code.] Update: This has certainly been a fascinating topic, and there's been some good participation and feedback. While the original purpose of the exercise was to compare the relative interop performance of the various flavors of Runtime in making a large number of fine-grained calls to the common libraries, it has since been demonstrated that tweaks to the logic can make a significant difference in performance. And in one case so far, the exercise has led to Esri's discovering and fixing a bug. Kudos to everyone who participated.
... View more
09-23-202110:42 AM
|
1
|
9
|
1224
|
POST
|
Looks like the issue has reappeared at 100.12.0 -- now the error message is "Invalid argument: geometry1 and geometry2 must have equivalent spatial references." Fortunately, I've kept my workaround code. UPDATE: I can't duplicate the error using the sample project above, so something else must be going on.
... View more
08-27-202112:24 PM
|
0
|
0
|
494
|
POST
|
According to the system requirements, Visual Studio 2017 15.9 or higher is supported at Runtime .NET 100.11, but when I try to install the VSIX I get the error "This extension is not installable on any currently installed products." Does it only install on VS 2019? BTW, I can add the NuGet package just fine.
... View more
04-26-202104:35 PM
|
0
|
1
|
676
|
POST
|
Thanks! Everything's working fine now.
... View more
04-09-202102:12 PM
|
0
|
0
|
735
|
BLOG
|
因为最后期限提交记录用户presentations for DevSummit 2021 was so tight (February 15!), there were some issues I ran into that I could not resolve in time, mainly revolving around the use of arcpy.mp in ArcGIS Server 10.8.1. As a workaround for the presentation, I created a standalone enterprise 10.8 install on a test box in Flagstaff, which was quite slow. The recorded presentation is available here: https://www.youtube.com/watch?v=19eQ7Gp1LoI The slides and sample code are also available here: http://www.pierssen.com/arcgis/python.htm Arcpy.mp Errors It turns out that most of the issues I encountered at 10.8.1 were fixed by a single patch, the "Print Service and Text Element Patch," available here: https://support.esri.com/en/Products/Enterprise/arcgis-server/ArcGIS-Server/10-8-1#downloads?id=7868 Here’s a list of the problems I encountered which were fixed by the patch: Layout.listElements("TEXT_ELEMENT") fails: "java.lang.Exception: Could not service request." Setting TextElement.text fails: "java.lang.Exception: Could not service request." UniqueValueRenderer.listMissingValues crashes Layout.exportToPDF fails: "OSERROR" Since installing the patch, I was able to implement the web tool and application on our 10.8.1 Q Portal in Tucson, which is considerably faster. The COTTONWOOD 1 map, which took 51 seconds to run in the presentation, took only 14 seconds to run in the Q Portal. Authentication: arcpy vs. ArcGIS API for Python Another issue that I ran into was authentication. While the ArcGIS API for Python correctly encapsulates the identity of the user of the web tool, the arcpy identity is the owner of the ArcSOC process. Why is this a problem? If the layers in a Pro project are not available to the ArcSOC owner, they will not render in the exported PDF. Currently, there is no way for arcpy to sign into portal using the credentials of the web tool user. [If this is a concern to you, please vote up my idea here: //www.gobook3.com/t5/python-ideas/arcpy-sign-into-portal-using-python-api/idi-p/1039109 ] For the presentation, I worked around the problem by sharing the layers with everyone. However, this is not acceptable for sensitive map data in a Portal which is exposed to the public. The workaround I settled upon is to use the “cryptography” module which is included with ArcGIS Pro: https://pypi.org/project/cryptography/ I created a built-in user in Portal which could access the layers in the Pro project, and created a text file in the project folder containing the encryption key and the encrypted user name and password. I then used that file to sign arcpy into Portal: def _SignIn(self): # Retrieve credentials and sign in to Portal from cryptography.fernet import Fernet sKeyFile = os.path.join(self.__sProjectDir, "Encrypted.txt") with open(sKeyFile) as f: sContent = f.read() tok = sContent.split("\n") sKey = bytes(tok[0], encoding="utf-8") sUserTok = bytes(tok[1], encoding="utf-8") sPassTok = bytes(tok[2], encoding="utf-8") f = Fernet(sKey) sUser = f.decrypt(sUserTok) sPass = f.decrypt(sPassTok) sPortal = arcpy.GetActivePortalURL() arcpy.SignInToPortal(sPortal, sUser, sPass) return See the updated version of the Python toolbox (attached) for more info.
... View more
04-09-202102:06 PM
|
0
|
0
|
924
|
BLOG
|
While the above web tool example works at Server 10.8, it broke for me at 10.8.1. However, there is a patch which fixed the problem: "Print Service and Text Element Patch." For more information, see my blog post: "Follow-up: Utility Network, ArcPy.mp, and JSAPI Enable Map Product Delivery via Portal."
... View more
04-09-202101:54 PM
|
0
|
0
|
512
|
POST
|
我似乎不能够创建博客anymore. As a follow-up to my DevSummit 2021 user presentation, I tried adding a comment to an existing blog post of mine, and the comment winked out of existence. I tried it again with the same result. Now my old blog post indicates 2 comments, but displays nothing. //www.gobook3.com/t5/developers-blog/migrating-a-plot-from-arcobjects-and-arcmap-to-arcpy-mp-and/ba-p/892273 [Updated Url - somehow a bad one crept in]
... View more
04-09-202110:25 AM
|
0
|
2
|
774
|
POST
|
Whoa! Here at the former GeoNet, the Community UI booted me right out and required my signing in again. Naughty, naughty! Aside from that, my favorite DevSummit streaming peeves: buffering, buffering, dropping out, skipping, etc. I totally dropped connection twice so far. On the other hand, I am glad that I could download slide decks right away (ahem! only for certain sessions). Push comes to shove, this is no replacement for the real thing. But I commend the Esri staff for doing what they can.
... View more
04-07-202110:31 PM
|
1
|
0
|
676
|
的想法
|
When a Python tool is published as a web tool, the user's credentials are available via the GIS object in the Python API. However, those credentials cannot be used in arcpy.SignInToPortal in order to access Portal layers in a Pro project. I would like to see either a new method on the GIS object to sign in arcpy, or else allow the GIS object as an argument in the arcpy function.
... View more
03-21-202101:14 PM
|
3
|
0
|
730
|
Title | Kudos | Posted |
---|---|---|
1 | 01-04-201206:42 AM | |
1 | 09-23-202110:42 AM | |
2 | 09-28-202107:07 AM | |
1 | 04-07-202110:31 PM | |
3 | 03-21-202101:14 PM |
Online Status |
Offline
|
Date Last Visited |
01-07-202208:31 AM
|