Python error on **line 230** of Core_Mapper.py

390 views
Skip to first unread message

Shaoyin Sun

unread,
Jul 30, 2018, 8:00:41 AM7/30/18
to Linkage Mapper
Hi all,

I am a beginner of Linkage Mapper (and also a bit new to ArcGIS). I am trying to create a connectivity map, I generated a resistance layer using Gnarly Utilities and now am trying to create a habitat layer. Am wondering what the 'product' selection mean since the user guide did not explain much on the choices under 'Habitat Suitability Calculation Method'. And also, when I successfully run the 'product' selection for a habitat layer and added it to ArcMap, it asked me to create pyramids. Whether I choose to create pyramids or not nothing is showing up and it's just a blank layer.

Also, I am trying to run the Core Mapper tool for creating a core area map, I keep getting an error on the python script line 230 and "RuntimeError: ERROR 999998: Unexpected Error". The same error happened when I tried to run the Core Mapper Demo. I'm using ArcMap 10.5.1 on Win 10 pro, and now I have downloaded two patches "ArcGIS-1051-DT-SAIAT-Patch" and "ArcGIS-1051-DT-SAZST-PatchB" as suggested by some people online, but it still is not working. I've posted the error message below. Any help or suggestions would be greatly appreciated.


Thanks,
Shaoyin


Executing: CoreMapper2 C:\CoreArea\Parameters.xlsx
Start Time: Mon Jul 30 19:39:47 2018
Running script CoreMapper2...

Core Mapper version 0.1.9

-----------------------------------------------------------------
If you use this software, please cite it so others can find it!
for preferred citation
-----------------------------------------------------------------

***************************************
READING C:\CoreArea\Parameters.xlsx


***************************************
PROCESSING Demo1 run.

Starting core processing for output: Demo1

Habitat model is C:\CoreArea\habitat

Resistance model is C:\CoreArea\resistance

Base folder is C:\CoreArea\output

Calculating average habitat value within a 500.0 Meter moving window radius

Converting moving window result to binary habitat model based on moving window average >= 0.8
and per-cell habitat values >= 0.8

Expanding cores by 2000.0 Meters in cost-weighted distance

Done expanding cores.
****Python error. Details follow.****
Python error on **line 230** of Core_Mapper.py
RuntimeError: ERROR 010240: Could not save raster dataset to %1 with output format %2.
Completed script CoreMapper2...
Failed to execute (CoreMapper2).

John Gallo

unread,
Aug 24, 2018, 1:34:19 AM8/24/18
to Linkage Mapper
Hi Shaoyin,

Sorry, somehow I am just now seeing this.  As of now, we are not actively maintaining Core Mapper, but maybe we should add that to the wish list.  I wonder if it is a new software versioning issue.  If someone else gets core mapper to work with Win 10 please let us know, and what version of ArcGIS youa re using.

Shaoyin, in the meantime, you can build the core areas manually vei various methods.  See also the post Annie made a few weeks ago linking to Wade et al. 2015.

Thanks,

John

Shaoyin Sun

unread,
Sep 8, 2018, 7:49:44 AM9/8/18
to Linkage Mapper
Hi John,

Thanks for the reply. I'm using ArcGIS version 10.5.1. I actually figured to create the habitat layer using raster calculator and a series of smoothing tools. But I'm having a different problem now. I tried to run the Linkage Pathways lab exercise in ArcCatalog, and it's giving me the messages below:

Executing: MapLinkages C:\Lab C:\Lab\LM_Lab_Data\LI_Cores.shp Core_ID C:\Lab\LM_Lab_Data\li_resist true true "Cost-Weighted & Euclidean" # true true false 4 Cost-Weighted true true true 200000 # # # # #
Start Time: Sat Sep 08 19:18:23 2018
Running script MapLinkages...
---------------------------------
A record of run settings and messages can be found in your log directory:
C:\Lab\run_history\log
---------------------------------

********************************************************
NOTE: Linkage Mapper tools often work best when run  from ArcCatalog instead of ArcMap. 


Linkage Mapper Version 2.0.0
on ArcGIS Desktop 10.5.1 Service Pack N/A
Setting data frame spatial reference to that of core area feature class.
 
---------------------------------
Starting at step 1.

Making temporary copy of resistance raster for this run.
ERROR: Could not make a copy of your resistance raster. Try re-starting ArcMap to release the file lock.
---------------------------------
Python error on **line 142** of lm_master.py in Linkage Mapper Version 2.0.0:
SystemExit: 1
---------------------------------
A record of run settings and messages can be found in your log directory:
C:\Lab\run_history\log
---------------------------------


And when I tried to run this tool with my own data, it gives a different message:

Executing: MapLinkages C:\Lab 1 Id SambarSum true true "Cost-Weighted & Euclidean" # true true false 4 Cost-Weighted true true true 200000 # # # # #
Start Time: Sat Sep 08 19:32:51 2018
Running script MapLinkages...
---------------------------------
A record of run settings and messages can be found in your log directory:
C:\Lab\run_history\log
---------------------------------

Linkage Mapper Version 2.0.0
on ArcGIS Desktop 10.5.1 Service Pack N/A
Setting data frame spatial reference to that of core area feature class.
 
---------------------------------
ERROR: Core area field name "ID", "FID", "OID", and "Shape" are reserved for ArcGIS. Please choose another field- must be a positive integer.
---------------------------------
Python error on **line 2227** of lm_util.py in Linkage Mapper Version 2.0.0:
SystemExit: 1
---------------------------------
Python error on **line 102** of lm_master.py in Linkage Mapper Version 2.0.0:
SystemExit: 1
---------------------------------


Annie Prisbrey

unread,
Sep 10, 2018, 6:03:53 PM9/10/18
to linkage...@googlegroups.com
Hi Shaoyin,

My recommendation for the first error is to close all instances of ArcMap and ArcCatalog you have open and try again. Lock files are created when you have the datasets open in Arc, and it's possible you had an instance of it open somewhere. If you still get the same error, you can go into the directory you are using for the run and see if there are any lock files present, and delete them manually.

For the second error, it would seem that you are using a field named "Id" for your ID field. Since that is a field name that is limited to ArcGIS-generated attributes, it is giving you an error. You should try creating a new field with a different name (I'd recommend something like "Unique_ID") for your ID numbers and try running it again.

Best,
Annie

--
You received this message because you are subscribed to the Google Groups "Linkage Mapper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linkage-mapper+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--


Annie Jacobs Prisbrey

GIS Analyst

Conservation Biology Institute

136 SW Washington Ave, Suite 202

Corvallis, OR 97333

Remote office: Salt Lake City, UT

Cell: 805-886-8054


Shaoyin Sun

unread,
Sep 12, 2018, 2:16:53 AM9/12/18
to Linkage Mapper
Hi Annie,

Thanks for the suggestions. This time when I ran the tool and it tells me unable to build an attribute table (error message below). When I re-run the script to the same directory without deleting previous files, the lock problem occurred, so I'm guessing if it locked because I have already had something written? I am now wondering why this cannot build the attribute table it wanted... Is there something missing in my data? I used a .shp file for the polygon input of my habitat layer(I've added a new field with an unique name as you suggested), and used a raster file created using Gnarly resistance calculator for my resistance layer.


Thanks,
Shaoyin


---------------------------------
A record of run settings and messages can be found in your log directory:
C:\Pre_Restoration\run_history\log
---------------------------------
 

********************************************************
NOTE: Linkage Mapper tools often work best when run  from ArcCatalog instead of ArcMap. 


Linkage Mapper Version 2.0.0
on ArcGIS Desktop 10.5.1 Service Pack N/A
Setting data frame spatial reference to that of core area feature class.
 
---------------------------------
Starting at step 1.

Making temporary copy of resistance raster for this run.

Making temporary raster of core file for this run.
 
---------------------------------
Running script s1_getAdjacencies.py
Adjacency files will be written to C:\Pre_Restoration\datapass\adj

Calculating cost-weighted distance adjacency
Starting cost-weighted distance allocation...
Processing cell size: 329.758021782344
-------------------------------------------------
Failed to execute costAllocOut = CostAllocation(cfg.CORERAS, bResistance, cfg.TMAXCWDIST, cfg.CORERAS,"VALUE", outDistanceRaster);costAllocOut.save(alloc_ras) on try #1.

The following ArcGIS error is being reported on line line 187 of "C:\toolbox\scripts\s1_getAdjacencies.py":
ERROR 010419: Unable to build the attribute table of C:\Pre_Restoration\scratch\core_ras as required by the operation.
Failed to execute (CostAllocation).


********************************************************
NOTE: Linkage Mapper tools often work best when run  from ArcCatalog instead of ArcMap. 

Will try again. 
---------TRYING AGAIN IN 20 SECONDS---------

To unsubscribe from this group and stop receiving emails from it, send an email to linkage-mappe...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Annie Prisbrey

unread,
Sep 12, 2018, 12:52:27 PM9/12/18
to linkage...@googlegroups.com
Hi Shaoyin,

Yes, it's generally a good idea to direct to a new directory or delete outputs from the original directory just to avoid possible issues from the program trying to overwrite files.

Would you be able to send me your core and resistance layers so I could better see what the attribute table issue may be? It's hard to speculate without seeing the inputs. Usually this error comes from having the wrong type of raster, but since this raster is created by the program I'd need to see what your cores look like.

Thanks,
Annie

To unsubscribe from this group and stop receiving emails from it, send an email to linkage-mapper+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages