POST
|
Hi Dan, Yes, these are integer rasters so that explaination makes perfect sense - an interesting "Gotcha"! Good to know! Cheers
... View more
05-09-2019
03:40 AM
|
0
|
0
|
1913
|
POST
|
Hi Neeraj, thanks for the response. So I think I have narrowed down the problem. I don't think the issue lies entirely in RasterToNumpyArray. A large part of the issue comes from me comparing results created from Python 3 using the Arc Pro environment (run outside arc) with results from Python 2 run inside Arc 10 (various versions). It seems that when run outside arc some arguments for various functions are ignored in Arc Pro. A little more info... Prior to RasterToNumpy array I have extracted the Raster by mask with: ebm_ras = arcpy.sa.ExtractByMask(bhi_ras, shp) Arc 10 handles this well and creates a raster where cells outside the "extract shape" being masked and set to NA. Arc Pro on the other hand converts all cells outside the "extract shpe" to zero. I got around this by using Map Algebra instead of extract by mask. This is one cause for the difference in np.nanmean. But wait there's more... When I run RasterToNumpyArray with: ebm_np = arcpy.RasterToNumPyArray(in_raster = ebm_ras) Arc10 converts the No data values to values of 15... The real raster data consists of cell values from 0-5. to remedy this the follwowing can be used ebm_npa = arcpy.RasterToNumPyArray(ebm_ras, nodata_to_value=-100) and then convert -100 values to np.nan or ignore -100 values in calculation. Again in Arc Pro Python (outside of ArcPro) RasterToNumpyArray converts all NA values to zero regardless of the nodata_to_value value... Again this coulf be solved by using map algebra, specifying a value (e.g. -100) for NA values then converting to np array and running: array[array == -100] = np.nan In summary the problem appears not to lie with ArcMap but actually in ArcPro when using Python outside of the GUI. Cheers, Hugh
... View more
05-09-2019
12:59 AM
|
0
|
2
|
1913
|
POST
|
Thanks for looking into it! I totally agree - really impressed with ArcPro and particularly the Anaconda environment - makes things much easier. Unfortunately I am unlikely to be able to persuade the clients to switch over any time soon. I'll update when I find the issue!
... View more
05-03-2019
10:15 AM
|
0
|
0
|
1913
|
POST
|
Thanks Dan, really appreciate the ideas. numpy version is 1.9.3. It looks as though something is going funny with the raster to numpy array function... I belive you may be right with your suggestion about the handling of nan values. I've got some more probing to do though as numpy does appear to function correctly in both versions of python. I'll report back when I get a little further with this. Cheers, Hugh
... View more
05-03-2019
09:21 AM
|
0
|
2
|
1913
|
POST
|
So I'm working on building a custom python toolbox to aid the interpretation of a dataset we've created. The tool is simple it should extract key summary stats from the raster for a given area(s) defined by a polygon. I've built the tool using Arc Pro and in this environment everythin works as expected. However, Our clients are still using ArcGIS so the tool must be cross compatible. When moving the tool across to ArcGIS 10.6 everything goes terribly wrong... My first approach was to convert the raster to a numpy array and extract data from here - all very quick and easy. However, in ArcGIS numpy.nanmean would return a different value to Arc Pro and no matter what I did all calculatations on subsets returned zero. Additionally calculating numpy.std would crash due to memory error (I realise this is due to the the use of python 2 so less of an issue). So with numpy seemingly out I tried to use arcpy tools along these lines with raster properties and zonal histogram: stdVal = arcpy.GetRasterProperties_management(raster, property_type="STD").getOutput(0) ZonalHistogram(shp, "OBJECTID", raster, histtab) Once again, GetRasterProperties returns different values in ArcGIS than ArcPro Also the standard deviation property returns zero and all values calculated with zonal histogram are also zero. So any reasons for this - Does my ArcGIS build have a broken version of numpy - I will try to run the tool on another machine and report back but currently have no access. Any advice would be much appreciated. Cheers, Hugh
... View more
05-03-2019
12:26 AM
|
0
|
8
|
2170
|
POST
|
Right sorted now... I followed these steps as recomended by ESRI support to uninstall Arc Pro: Attempt to uninstall ArcGIS Pro from the Control Panel. If you can't do this, or it doesn't work, then proceed to the next step. Ensure that all ArcGIS Pro processes are not running in the Task Manager. These are usually the following: ArcGISCleanup.exe ArcGISPro.exe Rename/Delete the following files if they still exist: C:\Users\username\AppData\Local\ESRI\ArcGISPro and any other Pro folders C:\Users\username\AppData\Roaming\ESRI\ArcGISPro C:\Program Files\ArcGIS\Pro C:\ProgramData\Microsoft\Windows\StartMenu\Programs\ArcGIS\ArcGIS Pro Rename/Delete the following registry keys if they exist: HKEY_CURRENT_USER\Software\ESRI\ArcGIS Online For Pro Reboot the system, and attempt to run the Install of ArcGIS Pro. This should allow you to install the software as new. It was then necessary for ESRI to "recover" my license. Thanks for the help. Hugh
... View more
03-04-2019
08:37 AM
|
1
|
0
|
2226
|
POST
|
Hi Joe, Many thanks for the reply. I am fairly sure that I have a named user license. I access ArcPro via the enterprise login section. Prior to this error I had requested access to Arc Pro offline. As I am unable to open Arc Pro I am unable to edit my settings in the Portal - is there another way that I can access the portal? Time settings on my PC seem to be as normal... I have tried a complete uninstall - when running the additional microsoft utility that you provided I cannot locate ArcPro in the list of applications provided and therefore cannot run the utility as desired. I have manually gone through the registry and removed all reference to ArcPro. Following a reinstall I now recieve an error stating that I am registered to use Arc Pro on another device and therefore still cannot log in. I have spoken to the admin at my University, who have contacted ESRI. They have requested that my offline permissions be reset ( Do you know of a way I can do this myself?). Hopefully then I will be able to open Arc Pro and access the Portal - I will let you know if this solves the issue. Do I have any other options that I can try in the meantime? Many thanks again, Hugh
... View more
03-04-2019
01:32 AM
|
0
|
0
|
2226
|
POST
|
Hello, I ran a python script overnight, the aim of which was to import many files in GML format with Data interoperability's 'Quick Import' The task was fairly intensive and run across multiple processes. The programme failed and now I cannot open Arc Pro. On opening I am met with the following error message: "A clock-rollback has been detected on your system. Please successfully authorize against your licensing portal to clear this error. " I then try to login via my University's enterprise account and the error message appears again! I'd rather not do a complete reinstall if possible as this would involve rebuilding several conda environments. Any help would be much appreciated! Cheers, Hugh
... View more
02-28-2019
01:07 AM
|
0
|
5
|
4056
|
POST
|
I Was having issues with this - Couldn't clone the defualy ArcPro Python environment so I used Conda outside out ArcPro to fix the issue. I opened the default conda environment > opening this batch file: C:\Program Files\ArcGIS\Pro\bin\Python\Scripts\proenv.bat Then cloned the environment: conda create --name arcpro_clone --clone arcgispro-py3 activate arcpro_clone The environment was installed in: C:\Users\<user>\AppData\Local\ESRI\conda\envs\arcpro_clone following this it was possible to edit the environment with Conda directly Set up a batch(.bat) to open this env more effeciently in future with: @echo off set PATH=%PATH%;C:\Users\<user>\AppData\Local\ESRI\conda\envs\arcpro_clone\Scripts %windir%\system32\cmd.exe "/K" C:\Users\<user>\AppData\Local\ESRI\conda\envs\arcpro_clone\Scripts\activate.bat arcpro_clone Cheers
... View more
02-07-2019
12:26 AM
|
1
|
0
|
1157
|
Title | Kudos | Posted |
---|---|---|
1 | 03-04-2019 08:37 AM | |
1 | 02-07-2019 12:26 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|