How to filter out almost dupicate X Y (Easting Northing) coordinates?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to filter out almost dupicate X Y (Easting Northing) coordinates?
# 8  
Old 09-22-2010
Gentlemen,

I thank you very much for your efforts in try to helping me with this code.

As I said, note that I am working in a Microsoft Windows XP command prompt window environment. Not sure if that will have any effect on the syntax.

I put your code into a command text file.
I can't seem to get the code to work without errors when listed vertically, so
I had to put it all on one line, and then type.....
mawk -v range=5 -f awk_commands.txt FileIn.txt

But......

All it does is print the complete contents of the input file (plus that extra "secret" column) to the screen, and does not create the duplicate and unique files.

The other strange behaviour is that no matter what value I use for range, a negative number, 0, or 1000000, I get the same output:

PointNumber_0000001 1000000.123456 1000000.123456 10000.123456 1000001.75
PointNumber_0000010 1000001.234567 1000002.234567 10345.234567 1000001.75
PointNumber_0000100 1000010.345678 1000020.456789 10030.987654 1000012.75
PointNumber_0001000 1000050.345678 1000050.456789 10030.987654 1000051.25
PointNumber_0010000 1000123.123456 1000456.123456 10789.123456 1000125.50
PointNumber_0100000 1000123.123456 1000456.123456 10789.123456 1000125.50
PointNumber_1000000 1000000.123456 1000000.123456 10000.123456 1000001.75
PointNumber_2000000 1000011.345678 1000021.456789 10030.987654 1000012.75
PointNumber_3000000 1000051.000678 1000049.999000 10030.987654 1000051.25[/SIZE][/SIZE]
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Help with processing coordinates in a file.

I have a variation table (variation.txt) which is a very big file. The first column in the chromosome number and the second column is the position of the variation. I have a second file annotation.txt which has a list of 37,000 genes (1st column), their chromosome number(2nd column), their start... (1 Reply)
Discussion started by: Sanchari
1 Replies

2. UNIX for Dummies Questions & Answers

overlapped genomic coordinates

Hi, I would like to know how can I get the ID of a feature if its genomic coordinates overlap the coordinates of another file. Example: Get the 4th column (ID) of this file1: chr1 10 100 gene1 chr2 3000 5000 gene2 chr3 200 1500 gene3 if it overlaps with a feature in this file2: chr2... (1 Reply)
Discussion started by: fadista
1 Replies

3. UNIX for Dummies Questions & Answers

Length of a segment based on coordinates

Hi, I would like to have the length of a segment based on coordinates of its parts. Example input file: chr11 genes_good3.gtf aggregate_gene 1 100 gene1 chr11 genes_good3.gtf exonic_part 1 60 chr11 genes_good3.gtf exonic_part 70 100 chr11 genes_good3.gtf aggregate_gene 200 1000 gene2... (2 Replies)
Discussion started by: fadista
2 Replies

4. Shell Programming and Scripting

Differential substring removal using coordinates

Hello all, this might be better suited for a bioinformatics forum, but I thought I'd try my luck here as well. I have several tabular text files of DNA sequence reads that appear as such: File_1.txt >H01BA45XW GATTACAGATTCGACATCCAACTGAGGCATT >H02BG78WR CCTTACAGACTGGGCATGAATATTGCATACC... (3 Replies)
Discussion started by: vectorborne5
3 Replies

5. Shell Programming and Scripting

Determination n points between two coordinates

Hi guys. Can anyone tell me how to determine points between two coardinates. For example: Which type of command line gives me 50 points between (8, -5, 7) and (2, 6, 9) points Thanks (5 Replies)
Discussion started by: rpf
5 Replies

6. Shell Programming and Scripting

place cursor in specific coordinates

Hi, I have this problem on how to place the cursor in a text editor (for example: pico). I made this script that would attach comments to a script file then open the script file, I would like to know how to place the cursor in a specific place, for example at the end of the comments, ... (1 Reply)
Discussion started by: lechelle
1 Replies

7. Shell Programming and Scripting

Search for particular tag and arrange as coordinates

Hi I have a file whose sample contents are shown here, 1.2.3.4->2.4.2.4 a(10) b(20) c(30) 1.2.3.4->2.9.2.4 a(10) c(20) 2.3.4.3->3.6.3.2 b(40) d(50) c(20) 2.3.4.3->3.9.0.2 a(40) e(50) c(20) 1.2.3.4->3.4.2.4 a(10) c(30) 6.2.3.4->2.4.2.5 c(10) . . . . Here I need to search... (5 Replies)
Discussion started by: AKD
5 Replies

8. Shell Programming and Scripting

Calculating distance between two LAT long coordinates

hi, i have a pair of latitude and longitude and i want to calculate the distance between these two points. In vbscript i achieved in the following way...Now i want to implement this in unix shell scripting.... <% Dim lat1, lon1, lat2, lon2 const pi = 3.14159265358979323846 ... (8 Replies)
Discussion started by: aemunathan
8 Replies

9. Shell Programming and Scripting

Defining X and Y Coordinates Inside A Window

Hello, I am starting up an Xnest window and trying to place a program inside of it. I have the window inside of it now but it always spawns with the top left corner at (0, 0). I need to find a way to set the x and y coordinates to something other than (0, 0). I tried using the -geometry option... (1 Reply)
Discussion started by: lesnaubr
1 Replies

10. Shell Programming and Scripting

Removing dupicate lines in the file ..(they are not continuous)

I have duplicates records in a file, but they are not consecutive. I want to remove the duplicates , using script. Can some one help me in writing a ksh script to implement this task. Ex file is like below. 1234 5689 4556 1234 4444 (7 Replies)
Discussion started by: Srini75
7 Replies
Login or Register to Ask a Question
Geography::NationalGrid::TW(3pm)			User Contributed Perl Documentation			  Geography::NationalGrid::TW(3pm)

NAME
Geography::NationalGrid::TW - Module to convert Taiwan Datum (TWD67/TM2, TWD97/TM2) to/from Latitude and Longitude SYNOPSIS
You should _create_ the object using the Geography::NationalGrid factory class, but you still need to know the object interface, given below. use Geography::NationalGrid; use Geography::NationalGrid::TW; # default TWD97 my $point1 = new Geography::NationalGrid::TW( 'Easting' => 302721.36, 'Northing' => 2768851.3995, ); printf("Point 1 is %f X and %f Y ", $point1->easting, $point1->northing); printf("Point 1 is %f N and %f E ", $point1->latitude, $point1->longitude); # transform to TWD67 $point1->transform('TWD67'); DESCRIPTION
Once created, the object allows you to retrieve information about the point that the object represents. For example you can create an object using easting / northing and the retrieve the latitude / longitude. OPTIONS
These are the options accepted in the constructor. You MUST provide either Latitude and Longitude, or Easting and Northing. Projection Default is 'TWD97', the "TAIWAN DATUM 97". Another projection recognized is 'TWD67', but only 'TWD97' is tested. GridReference There is no grid reference in Taiwan datum. Grid related functions are disabled. Latitude The latitude of the point. Actually should be the latitude using the spheroid related to the grid projection but for most purposes the difference is not too great. Specify the amount in any of these ways: as a decimal number of degrees, a reference to an array of three values (i.e. [ $degrees, $minutes, $seconds ]), or as a string of the form '52d 13m 12s'. North is positive degrees, south is negative degrees. Longitude As for latitude, except that east is positive degrees, west is negative degrees. Easting The number of metres east of the grid origin, using grid east. Northing The number of metres north of the grid origin, using grid north. Userdata The value of this option is a hash-reference, which you can fill with whatever you want - typical usage might be to specify "Userdata =" { Name => 'Dublin Observatory' }> but add whatever you want. Access using the data() method. METHODS
Most of these methods take no arguments. Some are inherited from Geography::NationalGrid latitude Returns the latitude of the point in a floating point number of degrees, north being positive. longitude As latitude, but east is positive degrees. easting How many metres east of the origin the point is. The precision of this value depends on how it was derived, but is truncated to an integer number of metres. northing How many metres north of the origin the point is. The precision of this value depends on how it was derived, but is truncated to an integer number of metres. deg2string( DEGREES ) Given a floating point number of degrees, returns a string of the form '51d 38m 34.34s'. Intended for formatting, like: $self->deg2string( $self->latitude ); data( PARAMETER_NAME ) Returns the item from the Userdata hash whose key is the PARAMETER_NAME. transform( PROJECTION ) Transform the point to the new projection, i.e. TWD67 to TWD97 or reverse. Return the point after transformation and keep original point intact. Uses the formula proposed by John Hsieh which is supposed to provide 2 meter accuracy conversions. ACCURACY AND PRECISION
The routines used in this code may not give you completely accurate results for various mathematical and theoretical reasons. In tests the results appeared to be correct, but it may be that under certain conditions the output could be highly inaccurate. It is likely that output accuracy decreases further from the datum, and behaviour is probably divergent outside the intended area of the grid. This module has been coded in good faith but it may still get things wrong. Hence, it is recommended that this module is used for preliminary calculations only, and that it is NOT used under any circumstance where its lack of accuracy could cause any harm, loss or other problems of any kind. Beware! REFERENCES
http://wiki.osgeo.org/wiki/Taiwan_datums John Hsieh - http://gis.thl.ncku.edu.tw/coordtrans/coordtrans.aspx AUTHOR AND COPYRIGHT
Copyright (c) 2006 Yen-Ming Lee "<leeym@leeym.com>". All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.10.0 2009-09-06 Geography::NationalGrid::TW(3pm)