[Liblas-devel] create in internal lab *.exe with Python and Liblas (problem)

gianni lavaredo gianni.lavaredo at gmail.com
Sun Sep 23 03:53:09 PDT 2012


Dear memebrs list,

I wish to create un file *.exe for internal lab use with Python + Libals
module. This exe read las file, shape file and clip the points inside the
shapes file (ex: plots or polygons).

After I wrote the code I use py2exe to convert my *.py script in a *.exe.
After that when i run my exe i have this message:

ClipLAS2LAS.exe
Traceback (most recent call last):
File "ClipLAS2LAS.py", line 14, in <module>
File "liblas\__init__.pyc", line 2, in <module>
File liblas\core.pyc",line 353, in __init__
WindowsError: [Error 126] Impossible to find the specified module


Thanks!!! for any suggestions and Help
:)


This is my Python code:
#!/bin/env python

from liblas import file
from liblas import file as lasfile
from liblas import vlr
from liblas import header as lasheader
import shapefile
import numpy as np
import matplotlib.nxutils as nx

#import os
#os.chdir("C:\PythonWork")
#print(os.listdir('.'))

# LAS file INPUT
READFILE = raw_input("INPUT LAS filename (*.las):")
# Shp file INPUT
READFILE_SHP = raw_input("INPUT Shapefile filename (*.shp):")
READFILE_SHP = str(READFILE_SHP)
# LAS file OUTPUT
WRITEFILE = raw_input("OUTPUT LAS filename (*.las):")


f = lasfile.File(READFILE,None,'rb') # open LAS
h = f.header
file_out = lasfile.File(WRITEFILE,header=h,mode='w')

sf = shapefile.Reader(READFILE_SHP) #open shpfile

shapes = sf.shapes()
for i in range(len(shapes)):
    verts = np.array(shapes[i].points,float)
    for p in f:
        test = nx.pnpoly(p.x,p.y, verts)
        if test == 1:
            file_out.write(p)
        elif test == 0:
            del p

file_out.close()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/liblas-devel/attachments/20120923/76bb50cf/attachment.html>


More information about the Liblas-devel mailing list