POST
|
I spoke too soon - this was an easy fix by just not hardcoding the scratch workspace in the script! It works now...
... View more
12-27-2012
04:39 AM
|
0
|
0
|
796
|
POST
|
I have a python script which when run in ArcMap works perfectly.... When creating the script tool in ArcMap, "Always run in foreground" is unchecked, "store relative path names" is checked, and "run python script in process" is checked. However, when I publish this script to an ArcGIS for Server 10.1 SP1 installation, executing the GPService fails with the following error from the logs: Traceback (most recent call last): File "E:\arcgisserver\directories\arcgissystem\arcgisinput\EON\AirportsExportPython.GPServer\extracted\v101\toolboxes\AirportsExport.py", line 38, in <module> outputFclass = arcpy.env.scratchWorkspace+"\\clipped.shp" File "c:\program files\arcgis\server\arcpy\arcpy\geoprocessing\_base.py", line 525, in get_ return self[env] File "c:\program files\arcgis\server\arcpy\arcpy\geoprocessing\_base.py", line 575, in __getitem__ return convertArcObjectToPythonObject(getattr(self._gp, item)) AttributeError: Object: Tool or environment <scratchWorkspace> not found Here is the script: import arcpy, csv, os arcpy.env.overwriteOutput = True # Script arguments Selecting_Geometry = arcpy.GetParameterAsText(0) if Selecting_Geometry == '#' or not Selecting_Geometry: Selecting_Geometry = r"E:\EON\data\templates.gdb\polygonTemplate" OutputType = arcpy.GetParameterAsText(1) if OutputType == '#' or not OutputType: OutputType = "kmz" # Local variables: arcpy.env.scratchWorkspace = r"E:\EON\temp" outputFclass = arcpy.env.scratchWorkspace+"\\clipped.shp" AirportsLayer = r"E:\EON\layers\LandingFacilitiesOrganized.lyr" Airports = r"E:\EON\data\FAA.gdb\airports" exportLayer = arcpy.env.scratchWorkspace+"\\exportLayer.lyr" # Process: Clip arcpy.Clip_analysis(Airports, Selecting_Geometry, outputFclass, "") OutputFile = arcpy.env.scratchWorkspace+"\\airportsExportResult.kmz" earthLayer = arcpy.mapping.Layer(AirportsLayer) for layer in earthLayer: if layer.isGroupLayer: continue else: layer.replaceDataSource(arcpy.env.scratchWorkspace, "SHAPEFILE_WORKSPACE", "clipped") earthLayer.saveACopy(exportLayer) arcpy.LayerToKML_conversion(exportLayer, OutputFile, "1", "false", exportLayer, "1024", "96", "CLAMPED_TO_GROUND") arcpy.SetParameterAsText(2,OutputFile) In short, this script clips a feature set to an input polygon, applies a complicated layer file to it, then exports to kmz. I got this geoprocessing tool working correctly earlier, but was using arcpy.env.workspace instead of arcpy.env.scratchWorkspace, so the process wasn't referencing the clipped file in a jobs directory, but instead in the hardcoded workspace directory in the script. Anyway, after some research I saw that I have to use scratchWorkspace for all intermediate data. But this broke the geoprocessing service. Any assistance would be greatly appreciated! Thanks, Jay
... View more
12-26-2012
11:02 AM
|
0
|
1
|
2773
|
POST
|
I didn't see anything about multi-named certificates in that post. Did I miss something there? Would I just separate the host names by commas?
... View more
12-23-2012
03:49 PM
|
0
|
0
|
292
|
POST
|
Hi - a couple questions regarding SSL certs for ArcGIS for Server 10.1 1. Does ArcGIS for Server 10.1 support CA-signed UCC SSL certs (multiple domain certs)? 2. If so, how would we generate the certificate for the CA to sign using the ArcGIS for Sever Administration utility? Can you specify two names in the "common name" field? 3. What is the recommended method for renewing our certificates when they are about to expire? Do we have to generate another cert from the admin utility and submit to the CA to sign, or just update the root cert in the server store? Thanks for your assistance! Jay
... View more
12-18-2012
07:01 AM
|
0
|
3
|
409
|
POST
|
Thanks all - I got it working. The wildcard cert worked by creating a cert from the admin utility specifying the actual hostname, then submitting that to our CA and creating a duplicate using our wildcard cert order. Jay Jay, Are you using the webadaptor to expose your GIS services? If so, you should just be able to import your certificate at the web server level, enabling SSL there (if not already which i'm guessing it already is), then secure your GIS server with SSL using the self-signed certificate as shown in the links above.
... View more
12-18-2012
06:50 AM
|
0
|
0
|
1494
|
POST
|
I have a relatively new installation of ArcGIS for Server 10.1. My IT department has provided a wildcard SSL cert from digicert to use on the server. However, the instructions to install a CA-signed certificate on the server are different: http://resources.arcgis.com/en/help/main/10.1/index.html#/Enabling_SSL_using_a_new_CA_signed_certificate/0154000005wr000000/ The instructs say I must generate a cert using the admin interface, then get our CA to sign it. Is that true? Can I not just install a wildcard SSL cert on the server? Jay
... View more
12-10-2012
04:49 AM
|
1
|
3
|
5520
|
POST
|
Thanks Shana! This is very informative! In your response, you say "In order to batch geocode using the new World Geocoding Service in ArcGIS Desktop 10.1 SP1, an ArcGIS Online Organization subscription is required." The problem is, I have an ArcGIS Online Organization subscription (at least I think I do, I can access the https://usdot.maps.arcgis.com site). From ArcMap, I sign into ArcGIS Online using those same credentials, but it still won't work. It still says I need an ArcGIS online account. For now I can use the workaround, but once tasks is depreciated, I won't be able to. So I'm curious if I'm doing something wrong (or my account is not what I thought it was), or if there is a bug! Thanks, Jay
... View more
11-26-2012
09:27 AM
|
0
|
0
|
988
|
POST
|
Hi - I would like to know how the REST API returns features to specify drawing order of a polygon layer using a unique value renderer. The JS API must know how (because it does it correctly) but we're querying the REST endpoint directly for use in a mash-up. We're trying to visualize hurricane wind swaths rendered by speed. So we have speeds of 58 mph, 32 mph, 74 mph, and error swaths, and they need to be drawn in a specific order (error, 32, 58, 74). Even when I publish with symbol levels enabled, the web service doesn't exactly return things in a preferred order, so a developer couldn't use a "first in first out" or "last in first out" methodology. The REST API returns json as 74, 58, 32, error, 74, 58, 32, error, 74.... until there is no more polygons left. Instead of returning all the 74 polygons first, and then 58 second, etc. etc. We could of course make specific rules for the hurricane layer, but we want something that is repeatable no matter what kind of polygon layer we use. The way I've worked around this currently is dissolving the layer based on symbol, so it just returns 74, 58, 32, error (since there is only one polygon per symbol), but was curious if there is any other way to specify how the REST API returns features.... Like I said, the JS API does it correctly, so it must know how to do that from somewhere! Thanks for your help! Jay
... View more
11-26-2012
09:19 AM
|
0
|
0
|
597
|
POST
|
I've loaded a CSV with a "Location" field that has the full address. When I try to geocode (using Wold Geocode Service from ArcGIS Online) based on this field, I get the following error: "There was an error trying to process this table. ArcGIS Online subsciption is required for geocoding the table of addresses." I have an ArcGIS online account, and I'm logged in through ArcMap. So what gives?
... View more
11-19-2012
11:26 AM
|
0
|
7
|
6643
|
POST
|
I am having this same problem! Once I installed the 64 bit background geoprocessing, a lot of my scripts started generating the error ExecuteError: ERROR 000210: Cannot create output..... What I can't understand is your workaround. If I'm running a python script outside of ArcMap, how can I use the "Enable checkbox for Background Processing on Geoprocessing | Geoprocessing Options". Thanks! Jay
... View more
11-13-2012
04:42 AM
|
0
|
0
|
357
|
POST
|
To create some custom scripts, I first create what I can in Model Builder, then export to Python and add what custom code I need. One problem I've ran into is when passing other python code into a function. In Model Builder, it is easy to maintain the code block, but once exported to Python, any significant amount of code becomes difficult to read or document. I was curious if arcpy functions accept function names as parameters instead of the actual code. Then I could refer to a separate function in my script instead of stuffing all my code into a single line. This is what an exported function looks like: arcpy.CalculateField_management(ModelAirports_shp__12_, "Zoom", "calcZoom(!FlDaily!, !UseType!, !Part139!, !OEP35!, !Core30!, !Type!)", "PYTHON_9.3", "def calcZoom(flights, use, part139, oep35, core30, type):\\n if (oep35 == 1) or (core30 == 1):\\n return 10000000\\n elif ((oep35 == 0) and (core30 == 0) and (part139 == 1) and (type == \"AIRPORT\") and (use == \"Public\")):\\n return 262144\\n elif ((oep35 == 0) and (part139 == 1) and (type == \"AIRPORT\") and (use == \"Private\")):\\n return 262144\\n elif ((part139 == 1) and (oep35 == 0) and (type == \"AIRPORT\") and (use == \"Military\")):\\n return 262144\\n elif ((part139 == 0) and (type == \"AIRPORT\") and (use == \"Public\") and (flights >= 250)):\\n return 131072\\n elif ((part139 == 0) and (type == \"AIRPORT\") and (use == \"Military\") and (flights >= 100)):\\n return 131072\\n elif ((part139 == 0) and (type == \"AIRPORT\") and (use == \"Public\") and (flights < 250) and (flights >= 100)) :\\n return 65536\\n elif ((part139 == 0) and (type == \"AIRPORT\") and (use == \"Private\") and (flights >= 100)):\\n return 65536\\n elif ((part139 == 0) and (type == \"AIRPORT\") and (use == \"Military\") and (flights < 100)):\\n return 65536\\n elif ((part139 == 0) and (type == \"AIRPORT\") and (use == \"Public\") and (flights < 100)):\\n return 32768\\n elif (((type == \"SEAPLANE BASE\") or (type == \"GLIDERPORT\") or (type == \"ULTRALIGHT\") or (type == \"BALLOONPORT\")) and ((use == \"Public\") or (use == \"Private\"))):\\n return 32768\\n elif ((part139 == 0) and (type == \"AIRPORT\") and (use == \"Private\") and (flights < 100)):\\n return 32768\\n elif ((type == \"HELIPORT\") and ((use == \"Public\") or (use == \"Military\"))):\\n return 16384\\n elif ((type == \"HELIPORT\") and (use == \"Private\")):\\n return 8192\\n else:\\n return 0") Easy to maintain in Model Builder [ATTACH=CONFIG]19251[/ATTACH] Was wondering if I could have something like this: arcpy.CalculateField_management(ModelAirports_shp__12_, "Zoom", "calcZoom(!FlDaily!, !UseType!, !Part139!, !OEP35!, !Core30!, !Type!)", "PYTHON_9.3", calcZoom(!Airports!, !Use!) and then define calcZoom in a different part of the script. Thanks! Jay
... View more
11-13-2012
04:14 AM
|
0
|
2
|
768
|
POST
|
Thanks! I think that is my problem - I would like to use the REST API, however can't figure out how to make the GET request (passing in the filter geometry to the map service and setting the export to KMZ) work for KMZ prgramatically. The reason I can't figure it out is because, as far as I know, GET requests can only be handled as text (json, text, html), but not as binary (zip, kmz). So I was wondering is there was a way around this (or if I have it entirely wrong). It here any ways browsers can handle binary responses from http get requests? The api says to use esri.request but I can't get it to deliver a KMZ. Thanks for your assistance! Jay
... View more
11-08-2012
05:59 AM
|
0
|
0
|
2263
|
POST
|
Thanks! This is a great example. However, we haven't integrated .NET customization into our Arc environment yet. Was wondering if there is a way to do this with Python (Model Builder) or just plain JavaScript with REST calls... Thanks, Jay
... View more
11-07-2012
06:22 AM
|
0
|
0
|
2263
|
POST
|
I'm trying to create a web app that allows a user to draw a polygon, and then the ability to export the features within that polygon. I partially got it working using a GP service based on a ModelBuilder model, but it seems to choke randomly (when a larger areas is chosen, but the number of features that should be returned is still far less than 1000). The server generates no errors when I look at the logs, but the JS api claims "Job 'j024c31e288b2441a9f429e093f8fce6e' does not exist or is inaccessible." The directory is clearly accessible and the kmz file is present. Anyway, was wondering if I might have better look directly making an esri.request and passing in the geometry. The only thing I can't figure out is how an esri.request can handle a kmz file. The only options are text, json, xml, but nothing that supports binary. Is my only choice to troubleshoot the geoprocessing service? Thanks, Jay
... View more
11-02-2012
07:36 AM
|
0
|
8
|
6625
|
POST
|
I'm having similar memory problems with a new install of Server 10.1 - any idea what VM setting you changed?
... View more
10-19-2012
05:17 AM
|
0
|
0
|
1071
|
Title | Kudos | Posted |
---|---|---|
1 | Wednesday | |
1 | 02-28-2024 07:43 AM | |
1 | 09-14-2022 06:39 AM | |
2 | 07-21-2023 07:11 AM | |
1 | 06-23-2022 07:46 AM |
Online Status |
Offline
|
Date Last Visited |
Thursday
|