file-open "ElevationData.txt" ; my code for importing the data
;
while [not file-at-end?]
[
let next-x file-read
let next-y file-read
let next-elevation file-read
ask patch next-x next-y [set elevation next-elevation]
]
file-close
let min-elevation min [elevation] of patches
let max-elevation max [elevation] of patches
ask patches [
set pcolor scale-color red elevation min-elevation max-elevation
]我想我必须转换数据以使其兼容!但是我该怎么做呢?我将包含要从文本文件导入的数据的图像:
http://postimg.org/image/jb4uqphbn/ http://s21.postimg.org/dzpy5zv92/elevation.jpg
发布于 2015-12-04 13:35:47
通过快速查看数据文件的图像,您需要在读取和处理空格时包含跳过文件头信息的逻辑,或者更简单的方法可能是将数据文件转换为.CSV并以这种方式读取它。此外,还需要对文件中的XY坐标进行转换和缩放,以使其适合面片坐标系。
https://stackoverflow.com/questions/34079637
复制相似问题