I have several ASCII text files which have 4 fields comma delimited.
The contents and format of each file is:
Point_Id,Easting_Coordinate,Northing_Cordinate,Elevation
The files have up to 10+ million records, so I presume that the computing time will be quite long.
I only have experience writing AWK one-liners.
I need the (presumed elaborate) coding of an AWK script that will perform the following on these files:
The objective is to delete points/records that are closer to each other than a user-defined-distance.
Some of the computing logic might be as follows:
1. First, using the Easting and Northing coordinates of each point, compute the distance between the FIRST point/record and all of the following points in the list, and DELETE those points whose distance from the FIRST point is less than the USER_DEFINED_DISTANCE.
2. You now might have to write the results list to a new file.
3. Next, using the Easting and Northing coordinates of each point, compute the distance between the SECOND point (in the new list) and all of the following points in the list, and DELETE those points whose distance from the SECOND point is less than the USER_DEFINED_DISTANCE.
4. You now might have to write the results list to a new file.
5. Next, using the Easting and Northing coordinates of each point, compute the distance between the THIRD point (in the next new list) and all of the following points in the list, and DELETE those points whose distance from the THIRD point is less than the USER_DEFINED_DISTANCE.
And so on, and so on.......... until you have reached the last point in the list.
The end result needs to be a comma delimited ASCII file of the same format as the input file.
If there is some other programming language that can produce the same results - please feel free to share.
Good Luck.
And Thank You,
Kenny.
The contents and format of each file is:
Point_Id,Easting_Coordinate,Northing_Cordinate,Elevation
The files have up to 10+ million records, so I presume that the computing time will be quite long.
I only have experience writing AWK one-liners.
I need the (presumed elaborate) coding of an AWK script that will perform the following on these files:
The objective is to delete points/records that are closer to each other than a user-defined-distance.
Some of the computing logic might be as follows:
1. First, using the Easting and Northing coordinates of each point, compute the distance between the FIRST point/record and all of the following points in the list, and DELETE those points whose distance from the FIRST point is less than the USER_DEFINED_DISTANCE.
2. You now might have to write the results list to a new file.
3. Next, using the Easting and Northing coordinates of each point, compute the distance between the SECOND point (in the new list) and all of the following points in the list, and DELETE those points whose distance from the SECOND point is less than the USER_DEFINED_DISTANCE.
4. You now might have to write the results list to a new file.
5. Next, using the Easting and Northing coordinates of each point, compute the distance between the THIRD point (in the next new list) and all of the following points in the list, and DELETE those points whose distance from the THIRD point is less than the USER_DEFINED_DISTANCE.
And so on, and so on.......... until you have reached the last point in the list.
The end result needs to be a comma delimited ASCII file of the same format as the input file.
If there is some other programming language that can produce the same results - please feel free to share.
Good Luck.
And Thank You,
Kenny.