|
POST
|
Took the Virtual Campus Creating Python Scripts for Raster Analysis, and the exercise shows me how to enter raster processing steps in the ArcGIS Pro python window, then at the end of the exercise, how to save the window contents to a python file so I could run it in a IDE or tool. I opened the file in IDLE, edited it, tried to run it, but the line "slopeRaster2 = sa.Slope(baseRaster,'DEGREE')" kept blowing up on me. I got it to work by changing the Slope line to arcpy.sa.Slope instead. It seemed to me that in IDLE, Slope might have been going to Slope_3d by default which has two required arguments, inraster and outraster, while sa.Slope only has one required argument. "DEGREE" wasn't working in Slope_3D which thought it was supposed to be the outraster. The script exported from the exercise: # coding: utf-8
import arcpy
from arcpy import *
baseRaster = Raster('DEM_elkhorn.tif')
baseRaster.maximum
# 2856.9016113281
baseRaster.minimum
# 2174.0673828125
baseRaster.noDataValue
# -3.4028230607370965e+38
slopeRaster = Slope('DEM_elkhorn.tif', 'DEGREE')
# Traceback (most recent call last):
# File "<string>", line 1, in <module>
# NameError: name 'Slope' is not defined
from arcpy.sa import *
slopeRaster = Slope('DEM_elkhorn.tif', 'DEGREE')
gThan40 = slopeRaster > 40
cliff = baseRaster - baseRaster.mean
cliffPresent = arcpy.sa.GreaterThan(cliff,160)
FalconHabitat = gThan40 & cliffPresent
FalconHabitat.save("C:\\EsriTraining\\PythonScriptsRaster\\Data\\HabitatOutput.tif") After editing a bit to clean up: import arcpy
from arcpy import *
from arcpy.sa import *
import arcpy.sa
baseRaster = Raster("C:\\EsriTraining\\PythonScriptsRaster\\Data\\DEM_elkhorn.tif")
#slopeRaster = Slope('C:\\EsriTraining\\PythonScriptsRaster\\Data\\DEM_elkhorn.tif', 'DEGREE')
slopeRaster2 = sa.Slope(baseRaster,'DEGREE')
gThan402 = slopeRaster > 40
cliff2 = baseRaster - baseRaster.mean
cliffPresent2 = arcpy.sa.GreaterThan(cliff,160)
FalconHabitat2 = gThan40 & cliffPresent
#FalconHabitat2.save("C:\\EsriTraining\\PythonScriptsRaster\\Data\\HabitatOutput2.tif")
I would have thought that the lines 1-4 trying every which way to import sa would have been sufficient, but line 6 kept blowing up, and going to line 7 using sa.Slope still wasn't good enough. But this worked: # coding: utf-8
#HabitatScriptEd3.py
#Created on 8/03/2018 by PH
#From exercise in ESRI Virtual Campus Course Creating Python Scripts for Raster Analysis
import arcpy
from arcpy import *
from arcpy.sa import *
arcpy.CheckOutExtension("spatial")
baseRaster = Raster("C:\\EsriTraining\\PythonScriptsRaster\\Data\\DEM_elkhorn.tif")
#slopeRaster = Slope('C:\\EsriTraining\\PythonScriptsRaster\\Data\\DEM_elkhorn.tif', 'DEGREE')
slopeRaster = Slope(baseRaster, 'DEGREE')
#slopeRaster2 = arcpy.sa.Slope(baseRaster,'DEGREE')
gThan402 = slopeRaster > 40
cliff2 = baseRaster - baseRaster.mean
cliffPresent2 = arcpy.sa.GreaterThan(cliff2,160)
FalconHabitat2 = gThan402 & cliffPresent2
#FalconHabitat2.save("C:\\EsriTraining\\PythonScriptsRaster\\Data\\HabitatOutput2.tif") So apparently, the three imports aren't enough to make sa available in a script running outside the Python window. I also need to check out the spatial extension. Along the way, I learned there is a different Python version installed for ArcMap 10.6.1 (Python 2.7.14) and for ArcPro 2.2 (Python 3.6.5). You can find the two different versions of IDLE and run the one that is appropriate by searching way down in Program files for idle.pyw. But an easy way to launch the correct version of IDLE is to examine the folder containing the script in File Explorer, right click, and there is a choice provided on which version to use. https://www.dropbox.com/s/z22101a2149z33x/pythonIDLE.png?dl=0 But it turns out with the full name to the Slope method, the script will run in python 2.7.14, the version from ArcMap 10.6.1. https://www.dropbox.com/s/t9utofy3fydra42/Python27.PNG?dl=0 I have SA licensed in Pro with a local license server, concurrent licensing. https://www.dropbox.com/s/kbvazf3vzrmm2mr/Screenshot%202018-08-01%2010.58.42.png?dl=0 But how does python in IDLE know this? I was real hopeful that http://pro.arcgis.com/en/pro-app/arcpy/functions/checkoutextension.htm was the answer since that's exactly my situation. But I got the same error as before. It seems that sa must be getting loaded because print (baseRaster.maximum) returns an answer. The error message seems indicate that python thinks Slope is a variable name that python doesn't know about. But it is not that Slope shouldn't be capitalized. https://www.dropbox.com/s/icyrnyhup79k50p/pythonslope.PNG?dl=0
... View more
08-03-2018
01:37 PM
|
0
|
0
|
1732
|
|
POST
|
When I click on "View the full discussion" in the email, or try to get into geonet from my browser today, I just get stuck at " "Forwarding to login.." Is that happening to everyone today? Wasn't there some warning about Geonet availability recently?
... View more
07-25-2018
05:25 PM
|
0
|
1
|
2015
|
|
POST
|
What would the upgrade from 10.3.1 to 10.6.1 be like? Would I just run the exe and my settings and databases would be preserved? And my users wouldn't have to update their connections? And redo the procedure to federate Portal to the new version of Server geodatabases? The upgrade from Server 9.3 to 10.3.1 was difficult, probably too long to wait. I think it was 2015. The versions of MS SQL Server were so far apart, the databases had to be backed up, restored to an intermediate version of MS SQL we found at another agency's servers, then restored to SQL Server 2012. Then the old data was loaded after manual inspection and selection to entirely newly organized databases, and all the users connections redone, all the data paths in map projects had to be restored.
... View more
07-25-2018
03:59 PM
|
0
|
4
|
2015
|
|
POST
|
I'm looking at this now, but I'm already stuck at step 2. "Click the Apps button in the header of your portal, then click on the Sites application to access the Sites administration app; you will be automatically signed in. " Apps button? Am I not finding the Apps button because this is 10.6 not 10.6.1? No, crap! I'm running Portal 10.3.1 because I am running it on top of Enterprise 10.3.1. That's probably why I'm not seeing this as described. When can I get off of this upgrade carousel?
... View more
07-23-2018
02:07 PM
|
0
|
6
|
2015
|
|
POST
|
I was unable to find the feature request part of the ESRI website today. Is it still available?
... View more
07-23-2018
09:17 AM
|
0
|
0
|
2015
|
|
POST
|
I just went through this so I wanted to see if I could submit a feature request. For me, my problem was the portal I was connected to,(upper right corner of Pro project page) wasn't a Organizational account. I thought it was but I have a bunch of possible accounts at ESRI, and only one is an Organizational account. The error message and the logs seem to indicate that an over loaded download server has timed out, but it never clears up. So this error message is not helpful, and the documentation is not helpful either. What you need to do is be signed into an Organizational account to get this to work from About>Software Update. If you don't have an Organizational account, you can still get a download of the windows installer exe file from somewhere else and run it. ESRI Customer Support showed me a trick to find your accounts' status, whether they are public or Organizational. Go to My ESRI with your browser, sign out if you are still connected, go to login, click on "forgot my user name", then very soon you will get an email from accounts@esri.com with the ESRI accounts that are associated with your email address, and which are public, and which are Organizational.
... View more
07-18-2018
05:08 PM
|
0
|
0
|
2970
|
|
POST
|
I like the way Yakima County has set up a page to permit downloads of GIS data sets with AGOL. https://gis-yakimacounty.opendata.arcgis.com/ Can I do this with Portal 10.3.1? Can you point me to the docs on this?
... View more
05-30-2018
02:02 PM
|
0
|
11
|
2577
|
|
POST
|
Yes, I guess that was it. The GPS points came in from a third party GPS utility which exported to a shape file in WGS 84. I thought it would be enough to make the data frame State Plane feet, but Locate Features didn't work until I ran the GPS points through Project to make a State Plane version. Hey! I accidentally found a GPS toolbar in 10.6! At what rev did that show up?
... View more
04-27-2018
04:24 PM
|
0
|
0
|
1676
|
|
POST
|
I just had a guy come through my office in a big hurry, wanting to know how far apart along a river were some points in his GPS. I've done this a lot so I can't figure out why it is not working today. I downloaded the GPS points from his units, converted them into shape files in WGS 84, threw together a map in ArcMap 10.6 with a basemap from ESRI so we would be confident in the points position. Then I added a routed hydro layer, made a selection of just one route , the main river, and added the selected route as a layer. But when I run "Locate Features Along Routes" I don't get an output table. I just get an unhelpful ERROR 999999. Why isn't this working? Is it the coordinate system I have fallen into? Identify Route Location tool is working with my route layers.
... View more
04-27-2018
03:27 PM
|
0
|
2
|
2084
|
|
POST
|
That was a strange one. I had to do a screen share with Cody at ESRI support to figure this out. Initially, he thought it was because my license server is on this LAN without a domain so the certificate is not getting relayed properly. But I said I have been running license server for years this way, and that this PC is the only one on this LAN that is having this problem. What we eventually figured out was I had to go from the security alert at Desktop start up to view certificate > install certificate > then don't take the defaults but manually install it for the machine in the trusted store. I think this was the first or second choice in the pull down. Had to repeat this for the second security alert. But the windows security warning when trying to access an ESRI basemap persisted. We had to shutdown Desktop, go to GIS Administrator > Advanced > Manage Portal Connections > highlight http:\\www.arcgis.com and manually Connect. After that base maps started working again in Desktop. I don't know how all the certificates that normally come with Desktop installation got flushed. Maybe it was a step I tried when trying to make Portal run better for me in this deficient LAN.
... View more
04-27-2018
11:40 AM
|
0
|
0
|
6741
|
|
POST
|
Thanks for the help. I just tried that procedure four times, and while it appears to successfully import and install a certificate, I still get two security challenges at startup of ArcMap and Catalog, and I still can't add a ESRI basemap.
... View more
04-27-2018
08:44 AM
|
0
|
0
|
6741
|
|
POST
|
Now that's weird. I'm getting a certificate error from Windows when I try to add a base map from ESRI. Dropbox - Clipboard01.jpg
... View more
04-26-2018
03:36 PM
|
0
|
1
|
6741
|
|
POST
|
That's not really my problem today, but I can give a little more background. In my field office, the LAN has a domain and a CA, so I finally got a cert working with Portal and Server and the Web Adapter, and got the Server federated with the Portal. Users can access Portal through a https url and are able to link Desktop and Pro to the Portal. But the problem I am having today is back at my home office. On this LAN I don't have a domain, and I don't have a CA. I have read up on self-signed certs, and can't figure out what they are good for. ESRI docs on Portal https://enterprise.arcgis.com/en/web-adaptor/10.3/install/iis/enable-https-on-your-web-server-portal-.htm say that with a self-signed cert I will not be able to get Portal federated with Server, or get GISPro to use my local Portal. But Portal is working real well for my customers in my home office when I just give them the url with port 7443 added, and tell them to add an exception to their browsers. I'm just using Portal here to deliver some specialized image services of mine to my users that are not using ArcGIS Desktop. The users are very pleased. Someday I'll add a domain and CA to this LAN. Today's problem is the server authentication error I'm getting when I start up ArcMap or ArcCatalog from my PC on this home office LAN. In my third post of this string, I thought I had it figured out. I still had a connection to the Portal without a certificate in my ArcGIS Administrator settings. Well, now I have removed that portal connection. Dropbox - noportal.PNG But why am I still getting four server authentication errors when I start up ArcMap? Where else is that bad Portal connection persisting?
... View more
04-26-2018
01:57 PM
|
0
|
2
|
6741
|
|
POST
|
Yeah, I did it do myself when I was trying out Portal. I have Portal running on one of my field office LANs with a domain and was able to get a cert from my own CA. But on my home office LAN, have no domain or CA, so I was trying to cheat by using the portal url https://hostname:7443/arcgis Works for browser access but it is "unsupported" by ESRI, and I guess this is one of the reasons why. I think I will have to remove this portal link with ArcGIS Administrator. Dropbox - portalerror.PNG
... View more
04-25-2018
12:25 PM
|
0
|
4
|
6741
|
|
POST
|
It's when I start up Desktop 10.6. With ArcMap I have to bybass the error four times. https://www.dropbox.com/s/9zi40u4zzt243ph/arcSecurityError.jpg?dl=0 I don't have Portal linked to Desktop or ArcGIS Pro. Haven't I seen this before, and it's ArcMap picking up the security settings in Internet Explorer?
... View more
04-25-2018
12:07 PM
|
0
|
0
|
6741
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 11-28-2018 04:57 PM | |
| 3 | 09-20-2017 02:37 PM | |
| 1 | 09-20-2017 02:21 PM | |
| 1 | 03-09-2018 03:25 PM | |
| 1 | 03-12-2015 02:06 PM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|