POST
|
We have a standalone ArcGIS Server site. Recently we have upgraded from 10.5.1 to to 10.9.1 and migrated services from ArcMap to ArcGIS Pro. We have a custom print service which works with our token secured services and for simplicity we initially published from ArcMap as we have done previously using embedded credentials: https://enterprise.arcgis.com/en/server/latest/publish-services/windows/printing-maps-that-contain-secured-services.htm This works fine. We would now like to migrate this custom print service to one published from ArcGIS Pro, so we will be able to update the site in the future to versions that don't support ArcMap publishing. I've followed the sample here: https://support.esri.com/en/technical-article/000026010 which appeared to work in ArcGIS Pro, but when I publish to ArcGIS Server and execute the tool, for any secure services I get the error: Unable to complete operation. Error executing tool. Export Web Map Task : Failed to create layer from service at https://xxxxx/arcgis/rest/services/xxxxx/MapServer. Failed to execute (Export Web Map). Failed to execute (Export Web Map Task). The documentation for arcpy.ImportCredentials states this is for nontoken-based secured services: https://pro.arcgis.com/en/pro-app/2.8/arcpy/functions/importcredentials.htm is this the reason for the error? - does anyone know of an alternative for token-based secured services or is something else going on? I said above that the custom print appeared to work in ArcGIS Pro - it does create a PNG with the secured services, but I now think it's not getting it's permissions for doing this from the .ags file via the python script. If I set up a connection to the ArcGIS Server site in ArcGIS Pro it works but if I remove this, close the project, reopen it and rerun the script it asks for credentials for the secure service, so can't be accessing what it needs from the connection file accessed via arcpy.ImportCredentials. I'm stumped - any suggestions gratefully received!
... View more
06-10-2022
02:30 AM
|
1
|
5
|
1205
|
POST
|
I’m trying to automate the update of a scene layer package in AGOL using a scheduled task and ArcGIS API for Python. The problem is uploading the package to AGOL - I’ve tried: slpk_Item = gis.content.search("{} AND owner:{}".format(sd_fs_name, user), item_type="Scene Package")[0] slpk_Item.update(data=slpk_path) and then tried to delete the package and re-add it using: gis.content.add(item_properties=slpk_properties, data=slpk_path) Both work fine on a small test scene layer package but on my real data (90MB), the package gets updated/added to AGOL but the functions don’t return – my guess is it's taking too long and there is a timeout. In the arcgis.gis module there is a status function which suggests it’s used to poll an asynchronous add request for completion, but I can’t find any help on how to send the add/update asynchronously. Can anybody give an example?
... View more
02-09-2019
11:51 AM
|
0
|
0
|
364
|
POST
|
thanks for your suggestions - i eventually managed to reduce the memory leak to an acceptable trickle using comReleaser. Final code is below: Public Function doSearch(ByVal SiteGeometry As IGeometry, ByVal SearchLayer As IFeatureClass, ByVal Buffer As Integer, ByVal shapeField As String, ByVal thewhere As String) As Boolean Using comReleaser As ComReleaser = New ComReleaser() Dim topoOperator As ITopologicalOperator = CType(SiteGeometry, ITopologicalOperator) comReleaser.ManageLifetime(topoOperator) Dim buffer2 As IGeometry If Buffer = 0 Then buffer2 = SiteGeometry Else buffer2 = topoOperator.Buffer(Buffer) End If comReleaser.ManageLifetime(buffer2) Dim spatialFilter As ISpatialFilter = New SpatialFilterClass() comReleaser.ManageLifetime(spatialFilter) spatialFilter.Geometry = buffer2 spatialFilter.GeometryField = shapeField spatialFilter.SpatialRel = esriSpatialRelEnum.esriSpatialRelIntersects spatialFilter.WhereClause = thewhere ' Execute the query. Dim featureCursor As IFeatureCursor = SearchLayer.Search(spatialFilter, True) comReleaser.ManageLifetime(featureCursor) Dim feature As IFeature = featureCursor.NextFeature() comReleaser.ManageLifetime(feature) If feature Is Nothing Then Return False Else Return True End If End Using End Function
... View more
12-08-2014
01:02 AM
|
0
|
0
|
295
|
POST
|
Hi All, I'm calling the function below several thousand times, but it just seems to increase memory usage until it falls over. I've tried Marshal.ReleaseComObject and ComReleaser without any luck. It seems to be related to the buffered geometry as if I give the non buffered geometry (SiteGeometry) to pSpatialFilter it seems fine. Any ideas how i release the memory used by this function? thanks, Andy Public Function doSearch(ByVal SiteGeometry As IGeometry, ByVal SearchLayer As IFeatureClass, ByVal Buffer As Integer, ByVal shapeField As String) As Integer Dim topoOP As ITopologicalOperator2 Dim pSpatialFilter As ISpatialFilter = New SpatialFilter topoOP = SiteGeometry topoOP.Simplify() Dim pGeometryBuff As IGeometry = topoOP.Buffer(Buffer) With pSpatialFilter .Geometry = pGeometryBuff .GeometryField = shapeField .SpatialRel = esriSpatialRelEnum.esriSpatialRelIntersects End With Dim theRowcount As Integer = SearchLayer.FeatureCount(pSpatialFilter) topoOP = Nothing pSpatialFilter = Nothing pGeometryBuff = Nothing pBC = Nothing Return theRowcount End Function
... View more
12-01-2014
10:57 AM
|
0
|
3
|
2895
|
Title | Kudos | Posted |
---|---|---|
1 | 06-10-2022 02:30 AM |
Online Status |
Offline
|
Date Last Visited |
09-02-2022
05:29 PM
|