I have a file that contains data with xy coordinates such as:
111 1 125000 9100000
111 2 130000 9150000
222 1 140000 9150000
222 2 155000 9200000
333 1 210000 9190000
333 2 110000 9010000
333 3 125000 9110000
444 0 130000 9150000
The 3 and 4th fields are x and y respectively.
I also have a control file like:
100000 9000000
150000 9000000
155000 9100000
200000 9200000
125000 9200000
110000 9100000
100000 9000000
These points are also x and y in order.
This file is an outline described by 4 or more corner points and the first and last point repeating.
This file is an outline that I want to use against the first data file.
If a data point from file 1 has a x and y point that falls inside the boundary points of file 2, I would print the entire record from file 1 to output, if not the point is ignored and so on for entire file.
If a point from file 1 falls on the boundary line between 2 boundary points, i would like to keep these points also along with the inside points.
I'm not sure if this is a simple task for Awk, I hope so.
Any help would be appreciated.
111 1 125000 9100000
111 2 130000 9150000
222 1 140000 9150000
222 2 155000 9200000
333 1 210000 9190000
333 2 110000 9010000
333 3 125000 9110000
444 0 130000 9150000
The 3 and 4th fields are x and y respectively.
I also have a control file like:
100000 9000000
150000 9000000
155000 9100000
200000 9200000
125000 9200000
110000 9100000
100000 9000000
These points are also x and y in order.
This file is an outline described by 4 or more corner points and the first and last point repeating.
This file is an outline that I want to use against the first data file.
If a data point from file 1 has a x and y point that falls inside the boundary points of file 2, I would print the entire record from file 1 to output, if not the point is ignored and so on for entire file.
If a point from file 1 falls on the boundary line between 2 boundary points, i would like to keep these points also along with the inside points.
I'm not sure if this is a simple task for Awk, I hope so.
Any help would be appreciated.