Dear memebrs list, <br><br>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).<br><br>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:<br>
<br>ClipLAS2LAS.exe<br>Traceback (most recent call last):<br>File "ClipLAS2LAS.py", line 14, in <module><br>File "liblas\__init__.pyc", line 2, in <module><br>File liblas\core.pyc",line 353, in __init__<br>
WindowsError: [Error 126] Impossible to find the specified module<br><br><br>Thanks!!! for any suggestions and Help<br>:)<br><br><br>This is my Python code:<br>#!/bin/env python<br><br>from liblas import file<br>from liblas import file as lasfile<br>
from liblas import vlr<br>from liblas import header as lasheader<br>import shapefile<br>import numpy as np<br>import matplotlib.nxutils as nx<br><br>#import os<br>#os.chdir("C:\PythonWork")<br>#print(os.listdir('.'))<br>
<br># LAS file INPUT<br>READFILE = raw_input("INPUT LAS filename (*.las):")<br># Shp file INPUT<br>READFILE_SHP = raw_input("INPUT Shapefile filename (*.shp):")<br>READFILE_SHP = str(READFILE_SHP)<br># LAS file OUTPUT<br>
WRITEFILE = raw_input("OUTPUT LAS filename (*.las):")<br><br><br>f = lasfile.File(READFILE,None,'rb') # open LAS<br>h = f.header<br>file_out = lasfile.File(WRITEFILE,header=h,mode='w')<br><br>sf = shapefile.Reader(READFILE_SHP) #open shpfile<br>
<br>shapes = sf.shapes()<br>for i in range(len(shapes)):<br>    verts = np.array(shapes[i].points,float)<br>    for p in f:<br>        test = nx.pnpoly(p.x,p.y, verts)<br>        if test == 1:<br>            file_out.write(p)<br>
        elif test == 0:<br>            del p<br><br>file_out.close()<br><br><br><br>