3,514 reputation
921
bio website esri.com
location
age
visits member for 4 years, 3 months
seen 6 hours ago

Geoprocessing team @ Esri. Tools, Models, Python, Services, Server, GPX and KML.


2d
comment How do I enumerate the messages in arcpy.GetMessages()?
Why not use arcpy.GetMessageCount and arcpy.GetMessage and get them 1 by 1 by index? resources.arcgis.com/en/help/main/10.1/index.html#/GetMessage/…
Mar
25
comment ArcGIS JS API: parse GP Service messages
You dont even need to go that far. Just pass your CSV, TXT, PDF? output into the SetParameter. The GP Framework will handle sending the URL to the JavaScript client. This code uses the output param name 'Output_Text_File': gp.getResultData(jobInfo.jobId,"Output_Text_File", downloadFile); and gets the value from it. (which .valee.url that the framework supplied)
Mar
25
comment ArcGIS JS API: parse GP Service messages
Cool, if you understand parsing, I'll point this out. The GP Framework returns a URL to a file to download (http ://yourserver). The tool itself, through execution can only provide you the location on disk that the file gets saved to. You (tool author) would have to have knowledge of server virtual dirs and server paths to return that path in a message. On top of that, you (tool author) are now responsible for making sure if 2 people run the service at the same time, that files arent trying to overwrite each other and return wrong paths to the consumer.
Mar
24
comment Referencing layer in Table of Contents using ArcPy?
What exactly is it you want to do? Are you doing arcpy.Mapping commands or do you want to run GP tools against layers in the ToC?
Mar
24
comment How to add 3D buildings in tourism map with ArcGIS?
That feature looks like its a multipatch, which should show up nicely in 3D. Open up your data in ArcGlobe or ArcScene and move the camera position to get your desired view point.
Mar
23
comment SaveToLayerFile failed - “value is not a layer”
You can save a lyr file that references a map service - its just a reference. You can also call SAVE right off the lyr object. You dont need to use the tool. But I'd suspect its the path you're using (unescaped backslashes) in the output as Erica points out.
Mar
17
comment Map To KML does not work with mxds that contain service layer
I added a map service from an AGS connection I made to here: sampleserver6.arcgisonline.com/arcgis/services , saved the MXD and ran the tool.
Mar
17
comment GPRecordSet in python toolBox
Using a GPFeatureSet or GPRecordSet as output is pretty uncommon. Can you explain the output of your tool (or will it be a service?) Typically you'd just use FeatureClass or Table as an output.
Mar
16
comment pandas.to_csv to write arcpy.getrasterproperties returns
It looks like you just want to pull raster stats for every raster in a directory and put that information into a CSV file? Is using pandas a requirement? Theres some built in CSV writers which might be a bit easier. (But yes, pandas is great)
Mar
15
comment Running Python toolbox tool both standalone from other tools within same Python toolbox?
I have a feeling what you're trying to do won't work, but can't confirm right now. One way that should work was if you import the tool into itself using arcpy.ImportToolbox() with a path to the PYT itself, then call arcpy.foo()
Mar
15
comment Calling a GP service from a GP service arcpy.Importtoolbox
Can you take your py script and get on the AGS machine and successfully run it? That would either rule out or confirm it's a "as a service" issue. I'd recommend against having a service call a service, but I suppose in theory it could work.
Mar
6
comment Preserving attributes during kml2shp conversion in ArcGIS for Desktop?
@sirgeo thats a nice little work around.
Mar
6
comment Preserving attributes during kml2shp conversion in ArcGIS for Desktop?
The Data Interop extension will honor the ExtendedData elements of a KML
Mar
6
comment Preserving attributes during kml2shp conversion in ArcGIS for Desktop?
As the 'owner' of the KML tool at Esri I can say: The ExtendedData elements inside a KML will not translate into field attributes when using the KML to Layer tool with ArcGIS at any version (9.3-10.3). This includes ArcMap on Windows, or ArcGIS Server on Linux. There is an enhancement request in to support this which we're considering for a future release.
Mar
3
comment Extent changing in ArcGIS Pro when shapefile added to map which only had basemap?
I suppose this is a bit opinion based on what should happen, but if I don't have any data loaded yet, I like that it navigates the display to my new data.
Feb
27
comment String parameter not passing correctly to GP service
Ok, that makes sense what you're doing. Not sure its the issue. Easiest way to check, make a copy of your script tool and strip the validator code and just pass in values you know are correct. After that, publish and see if you get the same issue. That'll narrow it down some.
Feb
27
comment String parameter not passing correctly to GP service
I cant make your screen shots bigger to see exactly what you're trying to show, but the last one looks like validator code? I dont know what its doing exactly, but understand a GP Service doesnt have the same validator code experience you get in desktop. That said, the code will still run when you execute the service. So if validation sets a parameter, it might be doing something you dont expect it to be as a service.
Feb
26
comment ArcGIS desktop map package, with clipping
Per the doc, extent with features does SELECT/EXTRACT. For Rasters it does a clip: For feature layers, the Extent parameter is used to select the features that will be consolidated. For raster layers, the Extent parameter is used to clip the raster datasets.
Feb
25
comment Set arcpy command line parameter same as Tool parameter
What tool are you passing "clip_layer" too? It sounds like that tool is specifically looking for a layer when you've given it a featureclass.
Feb
19
comment How do I get a result's status description instead of a status integer?
I think the real question is what are you after? Do you want to know its done? result.status > 3 Do you want actual messages? result.getMessages()