[Liblas-devel] about las2txt and las2tin
Riki Tiki
mongoose_riki at mail.ru
Tue Feb 23 14:21:37 EST 2010
Hi,
I have used above two tools. Thanks a lot for those in advance.
I did the following:
1) las2txt -i a.las -o coordinates.txt -parse xyz
2) las2tin -i a.las -o triangles.txt
My questions are as follows:
1) Do all the points in coordinates.txt should be appearing in triangles.txt?
I.e. for example if in coordinates.txt I have the following:
x0 y0 z0
x1 y1 z1
x2 y2 z2
...
x100 y100 z100
Where x0,y0,z0,...,z100 are floats. So I assume that in triangles.txt I will only see numbers
between 0 and 100 inclusive. Am I right on this? Also can I be 100% sure that all the numbers
between 0 and 100 will appear in triangles.txt at least in one triangle?
2) For example currently I have downloaded the following "http://liblas.org/samples/mscst000131.las" las file... I converted it using your tools above into coordinates.txt and triangles.txt, respectively as it is shown exactly above.
But then I run a program which consists of the following code:
//program written in c#
string[] triangles = File.ReadAllLines("triangles.txt");
string[] coordinates = File.ReadAllLines("coordinates.txt");
long counter;
for(long i=0; i<coordinates.Length; i++)
{
counter = 0;
for(long j=0; j<triangles.Length; j++)
{
string[] str = triangles[j].Trim().Split(' ');
if((long.Parse(str[0]==i))||((long.Parse(str[1]==i))||((long.Parse(str[2]==i)))
{
counter++;
}
}
Console.WriteLine("Line: "+i+", found "+counter+"times.");
}
Some of the lines are found to be 0 times. It means that not all of the coordinates appear in tins created? Am I doing something wrong? Or is it normal that some of them do not appear in tins generated?
Thanks a lot in advance!
Riki
More information about the Liblas-devel
mailing list