我有一段代码已经安装了必要的软件包。运行以下两行代码后,我遇到了问题:
data_all = spatial.readLidarPoints(inFile)
data_g = spatial.readLidarPoints(inFile,classification=lidarprocessor.CLASSIFICATION_GROUND)
运行这些行后,IPython控制台刚刚重新启动,我又回到了控制台行[1]。我在Ubuntu 18.04 LTS上使用了conda。
我将附上完整的代码:
import pylidar
from pylidar import lidarprocessor
from pylidar.toolbox import spatial
from pylidar.toolbox import interpolation
from functools import partial
import pyproj
import numpy as np
import gbdxtools
from gbdxtools.task import env
from gbdxtools import CatalogImage
import matplotlib.pyplot as plt
#from rasterio import features
import numpy.ma
from skimage import morphology
from gbdxtools.vectors import Vectors
import matplotlib.patches as Patches
from matplotlib.collections import PatchCollection
from matplotlib.patches import Polygon
from shapely import ops
from shapely.geometry import shape
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
import os
#import wget
inp = pyproj.Proj(init='epsg:32136') # 32136
outp = pyproj.Proj(init='epsg:4326')
tfm = partial(pyproj.transform, inp, outp)
BINSIZE = 1
def foot_to_meter(x):
return x*0.3048 # check resolution
def sp_to_wgs84(p):
xin, yin, zin = p
xout, yout = tfm(foot_to_meter(xin), foot_to_meter(yin))
return [xout, yout, foot_to_meter(zin)]
exists = os.path.isfile('tn_clean.las')
if exists:
inFile='tn_clean.las'
else:
inFile=wget.download('https://s3.amazonaws.com/notebooks-demo-data/tn_clean.las')
#(xmin, xmax, ymin, ymax)
data_all = spatial.readLidarPoints(inFile)
data_g = spatial.readLidarPoints(inFile,classification=lidarprocessor.CLASSIFICATION_GROUND)