LM3.1.0 error on line 266 of s2_buildNetwork.py

137 views
Skip to first unread message

杨鹏

unread,
Nov 16, 2023, 8:55:33 PM11/16/23
to Linkage Mapper
Hi,i run  LM3.1.0  in Arcgis Pro. And i always got the error. i read the conversation at  https://groups.google.com/g/linkage-mapper/c/3yBVXwaQdpk  . but  i did not solve this problem.
my .txt file  as follow

Build Network and Map Linkages
=====================
Parameters

Project Directory     F:\linkage_mapper_3_1_0\temp
Core Area Feature Class     core_area
Core Area Field Name     core_id
Resistance Raster     cost.tif
Step 1 - Identify Adjacent Core Areas     true
Step 2 - Construct a Network of Core Areas     true
Network Adjacency Method     Cost-Weighted & Euclidean
Core Area Distances File    
Step 3 - Calculate Cost-Weighted Distances and Least Cost Paths     true
Drop Corridors that Intersect Core Areas     true
Step 4 - Prune Network Using Options Below     false
Option A - Maxium Number of Connected Nearest Neighbors     4
Option B - Nearest Neighbor Measurement Unit     Cost-Weighted
Option C - Connect Neighboring Constellations     true
Step 5 - Calculate, Normalize and Mosaic Corridors     true
Truncate Corridors     true
Truncate Cost-Weighted Distance Threshold     200000
Bounding Circles Buffer Distance    
Maximum Cost-Weighted Corridor Distance    
Maximum Euclidean Corridor Distance    
Output for ModelBuilder Precondition    
Custom Settings File    
=====================
Messages

Start Time: 2023年11月16日 21:45:45
A record of run settings and messages can be found in your log directory:
F:\linkage_mapper_3_1_0\temp\run_history\log

********************************************************
NOTE: ArcGIS errors are more likely when writing to remote drives or deep file structures. We recommend shallow project directories on local drives, like C:\puma. Errors may also result from conflicts with anti-virus software (known problems with AVG). We have also seen conflicts when writing to synchronized folders like DROPBOX.

Note also that Linkage Mapper tools often work best when run from ArcCatalog instead of ArcMap.
 
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 F:\linkage_mapper_3_1_0\temp\datapass\adj

Calculating cost-weighted distance adjacency
Starting cost-weighted distance allocation...
Processing cell size: 200

Building output statistics and pyramids for CWD raster.
Cost-weighted distance allocation done.
Task took: 2 seconds.

Calculating adjacencies crossing allocation boundaries...
Task took: 3 seconds.

---------------------------------
Calculating Euclidean adjacency
Starting Euclidean adjacency processing...

Euclidean distance allocation done.
Task took: 1 seconds.

Calculating adjacencies crossing allocation boundaries...
Task took: 3 seconds.


---------------------------------
Running script s2_buildNetwork.py
Simplifying polygons for core pair distance calculations

---------------------------------
****Failed in step 2. Details follow.****
---------------------------------
Python error on **line 266** of s2_buildNetwork.py in Linkage Mapper Version 3.1.0:
ValueError: could not broadcast input array from shape (0,) into shape (1,3)
---------------------------------
A record of run settings and messages can be found in your log directory:
F:\linkage_mapper_3_1_0\temp\run_history\log
---------------------------------

F:\linkage_mapper_3_1_0\toolbox\scripts\s2_buildNetwork.py:262: UserWarning: loadtxt: Empty input file: "F:\linkage_mapper_3_1_0\temp\datapass\cwdAdj.csv"
  inAdjList = npy.loadtxt(adjFile, dtype='int32', comments='#',

Failed script Build Network and Map Linkages...
Failed to execute (MapLinkages).
Failed at 2023年11月16日 21:46:01 (Elapsed Time: 16.80 seconds)



John Gallo

unread,
Nov 17, 2023, 3:52:21 PM11/17/23
to linkage...@googlegroups.com
your error.txt file is showing up blank, and your copy and paste of the log file looks incomplete.  it is possible that you have two versions of the software on your computer, and yor toolbox is linking to the old one.

 I suggest you delete the old version of the software from your computer (or at least move it to a "temp" folder) , and you download and use v 3.1 , from here: https://linkagemapper.org/Downloads/ 

And whenyousend the log file, please tryt again as an attachment, but back it up with a copy and paste in the email, but include every character/word please.

Thank you ,

John

--
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-mappe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/linkage-mapper/5feefd69-492c-49da-906d-20b0ea275538n%40googlegroups.com.


--
John A. Gallo, Ph.D.
Project Director
LinkageMapper.org

and

Senior Conservation Scientist
Conservation Biology Institute
Message has been deleted

杨鹏

unread,
Nov 19, 2023, 9:16:30 PM11/19/23
to Linkage Mapper
Thanks for your help.
Finally, i found the solution about my problem.
 Because my core area is outside the resistance surface.
i used this tool sucessfullly when i changed my core area.
Reply all
Reply to author
Forward
0 new messages