POST
|
I am facing the challenge that I want to provide a GP tool on an ArcGIS Server 11.3, which should always use the credentials of the calling user when running. The call is made from an Experience Builder client so that I can customize the request accordingly. One possible solution would be to set up a separate parameter for the user token or the username. However, I don't like this solution for several reasons. I actually only want to receive the information required for processing in the parameters and not credentials. In addition, the signature of the tool would change. And I would have to do this for all my tools. I would prefer a transfer via the HTTP header. But I can't find a way to read the HTTP header in the context of an ArcGIS Server GP tool. An SOI doesn't seem to help either, as this can only be used for MapServices. Is it possible to access the HTTP header information within a GP Tool in ArcGIS? Are there any other ideas to realize this?
... View more
03-19-2025
04:20 AM
|
0
|
1
|
542
|
POST
|
I have a phenomenon here and am wondering whether this is a bug or work-as-designed. We receive geometries from a routing service as polylines (saved as JSON) and we want to unite them geometrically with the union function. (We have no Z-coordinates, so we cant't detect if it is a crossing or a bridge or so on.) edge1_shape:arcpy.Polyline = arcpy.AsShape(edge1.Geometry, True)
edge2_shape:arcpy.Polyline = arcpy.AsShape(edge2.Geometry, True)
edge1.Geometry = edge1_shape.union(edge2_shape).JSON So far, everything is fine in normal line segments. Something strange happens when the line crosses, like here The polyline, which normally consists of exactly one “part”, is split at the crossing point, as soon as the circle closes (at the exact same crossing point wich has already been added before) Now another part is created. So far everything, so good. However, the part that was traveled first and was previously part 0 ... ... suddenly becomes Part 1 and the newly inserted part is now Part 0. As far as I know, new parts are always added at the end. And then to top it all off: If the third part is added after the crossing point, then the first part is the last part (Part 2), the second section is the first part (Part 0) and the last section is the middle part (Part 1) This means that there is no sequence at all. I don't know any longer, which part was added first and which is the last part of my line. It looks like a bug to me.
... View more
02-11-2025
04:40 AM
|
1
|
4
|
787
|
POST
|
Hey, This topic is almost 5 years old, but I got a request right now from a customer asking if we can do Line of Sight analysis in 2D. And this is not for the first time we are getting this question. Are there any new findings here? Is this possible in the meantime? Are there workarounds for (creating in 3D and exporting to 2D)? Cheers, Max
... View more
12-01-2022
11:07 PM
|
0
|
1
|
1155
|
POST
|
I got no answer so far and I don't have a real solution. Possible ideas: Install an ArcGIS product which delivers arcpy (Pro or Server) on an machine which is used in the build process. But: no idea if this will work. And you are dependent on this installation, which could change with an auto update. Not really preferred. Try to isolate arcpy (and its dependencies) and include it in the version control system. No idea if this is possible with an acceptable effort. At least it will be a lot of data (my arcpy has 1,15 GB) in vcs. Even not sure if this is feasible because of the underlying ArcObjects core. Try to mock the arcpy calls. In my tests this works fine, but of course you will not be able to test all components with real conditions. What are your thoughts and attempts so far?
... View more
04-12-2022
03:15 AM
|
0
|
0
|
3664
|
POST
|
Well, we already use the arcgis for python API additionally, but it does not cover all our use cases. That's why we also need the arcpy module.
... View more
01-27-2022
12:17 AM
|
0
|
0
|
3741
|
POST
|
Hey guys, We are actually developing Web Tools based on ArcGIS Pro 2.8 to publish in ArcGIS Enterprise 10.8.1. We want to establish unit tests and want to run these tests in Azure DevOps Pipelines. While in a local environment I have an ArcGIS Pro installed, of course this is not the case in an Azure DevOps environment. And simply trying to install arcpy module with python install failed. What is the recommended scenario from Esri to establish this? Kind regards, Max
... View more
01-25-2022
08:44 AM
|
3
|
8
|
3799
|
POST
|
Depends on what you want to do: Either you can listen to the MouseWheel Event or you try to react after in the ViewpointChanged Event and set the viewpoint to the allowed focus. Maybe this gives you an idea: https://developers.arcgis.com/net/wpf/sample-code/geoview-viewpoint-synchronization/
... View more
12-01-2021
04:56 AM
|
0
|
0
|
2202
|
POST
|
Hi Sam, it seems that we could locate the reason for our problem. There were some texts in our layout that were apparently responsible for the problem. When we removed the texts, printing worked without any problems. We have found a patch that should fix the problem. Initial tests are promising. ArcGIS Server 10.8.1 Print Service and Text Element Patch Maybe this will work for you too. Kind regards, Max Kind regards, Max
... View more
08-22-2021
11:56 PM
|
0
|
1
|
2361
|
POST
|
Hi guys, I have a strange behaviour with my script which I wrote for a customer. Just the relevant lines ... import arcpy
import os
import sys
import logging
import logging.config
from datetime import datetime
# CONFIG Paths
Pdf_Path = r"C:\PrintServer"
Log_Path = r"C:\PrintServer\log"
Aprx_File = r"D:\data\PrintServer\COVID19_Print.aprx"
def main():
# Input Layout template
Layout_Template = arcpy.GetParameterAsText(0)
#open the ProProject
try:
aprx = arcpy.mp.ArcGISProject(Aprx_File)
layouts = aprx.listLayouts(Layout_Template)
except:
raise
#print each layout found
out_files = []
for lyt in layouts:
try:
now = datetime.now()
tmp_file_name = lyt.name + "_" + now.strftime("%Y%m%d_%H%M%S") + ".pdf"
Temp_File = os.path.join(arcpy.env.scratchFolder, tmp_file_name)
#This line always results in an OSError
lyt.exportToPDF(Temp_File, resolution = 300)
Output_File = os.path.join(Pdf_Path, tmp_file_name)
import shutil
shutil.move(Temp_File, Output_File)
out_files.append(Output_File)
except:
raise
arcpy.SetParameter(1, out_files)
if __name__ == '__main__':
try:
main()
except:
import traceback
logging.error(traceback.format_exc()) The idea is to provide a GPService which takes a public WebMap, uses a predefined ArcGIS Pro Project (.aprx) also published with the GPService, reading a layout and printing this layout as pdf document. In my tests on my machine and three different ArcGIS servers, this has been no problem. Also running on the customers ArcGIS Pro client worked as expected, but when rolling out on the customers server, we always get an OSError when executing the ExportToPDF method. What we already verified/tested: different file directories: hard coded temp folder or the scratch folder from arcgis shortened the file and directory names tripple checked write permissions, we have used different users, even full previliged from their IT department executed the script via GPService or via python shell, both results in the same OSError tested with ExportToJPG and ExportToPNG, both also produces the same error tested, if a PDF program is necessary (it is not) tested, if a PDF in general could be produced with python (is possible) So, this works: #Create the file and append pages
pdfDoc = arcpy.mp.PDFDocumentCreate(pdfPath)
pdfDoc.appendPages(referencePdf)
pdfDoc.saveAndClose() And now I don't have any other idea. Anybody of you have any? Has anybody a deeper look into that tool and can say, why this error could happen? Kind regards, Max
... View more
06-22-2021
12:58 AM
|
1
|
4
|
2533
|
POST
|
In fact, there seams not to be a method to directly create a polygon from an Envelope. But this is a way you can do it: private Geometry CreateFromEnvelope(Envelope envelope)
{
var builder = new PolygonBuilder(envelope.SpatialReference);
builder.AddPoint(new MapPoint(envelope.XMin, envelope.YMin));
builder.AddPoint(new MapPoint(envelope.XMin, envelope.YMax));
builder.AddPoint(new MapPoint(envelope.XMax, envelope.YMax));
builder.AddPoint(new MapPoint(envelope.XMax, envelope.YMin));
return builder.ToGeometry();
} Cheers
... View more
05-03-2021
08:39 AM
|
2
|
1
|
1867
|
POST
|
Hi Luke, The missing .xml you have mentioned to be on a new location is now missing again Seems it has been moved or deleted. Kind regards, Max
... View more
04-18-2021
11:44 PM
|
0
|
0
|
761
|
POST
|
Hi Michael, I am not allowed to post Ideas, I think this is a limitation for distributors, but I am not sure about that. But thanks for your respond. Kind regards, Max
... View more
03-11-2021
12:43 AM
|
0
|
0
|
1462
|
POST
|
You have 2 issues in your code. That's the correct way. WhereClauses are missing a quote: QueryParameters citiesNameQuery = new QueryParameters
{
WhereClause = $"AREANAME='{SearchTextBox.Text}'",
Geometry = MyMapView.GetCurrentViewpoint(ViewpointType.BoundingGeometry).TargetGeometry,
OutSpatialReference = MyMapView.SpatialReference
};
QueryParameters countiesNameQuery = new QueryParameters
{
WhereClause = $"NAME='{SearchTextBox.Text}'",
Geometry = MyMapView.GetCurrentViewpoint(ViewpointType.BoundingGeometry).TargetGeometry,
OutSpatialReference = MyMapView.SpatialReference
};
QueryParameters statesNameQuery = new QueryParameters
{
WhereClause = $"STATE_NAME='{SearchTextBox.Text}'",
Geometry = MyMapView.GetCurrentViewpoint(ViewpointType.BoundingGeometry).TargetGeometry,
OutSpatialReference = MyMapView.SpatialReference
}; And you referenced the same table three times, you need to use the associated tables: FeatureQueryResult citiesQueryResult = await citiesTable.QueryFeaturesAsync(citiesNameQuery);
FeatureQueryResult countiesQueryResult = await countiesTable.QueryFeaturesAsync(countiesNameQuery);
FeatureQueryResult statesQueryResult = await statesTable.QueryFeaturesAsync(statesNameQuery); Then it will work.
... View more
03-11-2021
12:35 AM
|
1
|
1
|
1628
|
Title | Kudos | Posted |
---|---|---|
1 | 02-11-2025 04:40 AM | |
2 | 09-20-2019 03:24 AM | |
2 | 09-26-2019 04:37 AM | |
3 | 01-25-2022 08:44 AM | |
1 | 06-22-2021 12:58 AM |
Online Status |
Offline
|
Date Last Visited |
03-28-2025
05:33 AM
|