georeference.org
Subscribe to this thread
Home - General / All posts - Latitude/Longitude Format
jimboydens26 post(s)
#17-Nov-08 22:50

I am downloading some coordinates in lat/long from a CAD software. The format is in ddd.mmss.

I have created a table in xls containing these points. When I import them to Manifold tables/drawings

how can i convert these into lat/long values?

the format is not in decimal degrees but in ddd.mmss but there are no spaces between the minutes and seconds part.

for example;

i want to change the format

123.1234 would represent 123D 12' 34"

thanks

cartomatic116 post(s)
#17-Nov-08 23:57

You have to split values into separate dd, mm, ss fields first - duplicate your coords into 3 columns and then remove not needed bits with DeleteRight & DeleteLeft table operators. When you've done with this you'll get your decimal degrees this way: decimal = dd + mm/60 + ss/3600. Active columnwill be handy :)

volker

372 post(s)
#18-Nov-08 00:28

Do you only want to see the coordinates in another format on screen ?

Then "Tools"->"Options"->"Status Bar"->"Report"

Or do you only want to see the coordinates in the Table in another Format ?

Then open the table "View"->"Columns"->make "Show all" so you see the

Lat (I) & Long (I) fields, go to the lat & long fields with right click mouse

in the opened bar go to "Format" and change from <default> to the format you like

volker

372 post(s)
#18-Nov-08 04:01

and as resumption look at the attachement.

I copy the values from Long/Lat in a Text Column after i change the format,

so you can get it as Text if you want it like this way...

Attachments:
LatLon_Text.pdf

vincent

635 post(s)
#11-Dec-08 17:41

Thank you Volker, it was really helpful for me today !


IMS codes, trainings and programming services available at www.dynamicmaps.net

spoedniek

328 post(s)
#18-Nov-08 02:05

If you have it in the format: dd mm ss (strictly one space between each), then Manifold will convert this automatically to lat/long values if you either link the table as a drawing, or change the column type to latitude or longitude. So you can split it up into three columns and then combine them into a Text type column. You can prepend a minus sign to indicate South or West. And then right-click on the column header and select Change Type. Select Latitude or Longitude from the types list. I'm pretty sure that if your values are in the right dd mm ss format you can simply link the table (or excel) sheet as a drawing and the values will automatically be converted. Unfortunately I can't find it documented in the help files. If it doesn't work this way then the help docs do describe the process as suggested by cartomatic above: http://www.manifold.net/doc/edit_a_table_with_the_transform_toolbar.htm

Henry

mapasPT1

306 post(s)
#18-Nov-08 02:27

Hello

Try this:

1. import the table with the data points

2. select the table and open the Table Design

3. In here, change the type of the column to Latitude and Longitude and close the Table Design

4. Open the table and select the column, enter in the Format and in the Style, change for what you want.

I hope this help

tjhb

2,384 post(s)
online
#18-Nov-08 02:02

Given [Table] with columns [Longitude], [Latitude] in the format you specify, this query will return decimal degrees in [DDx] and [DDy].

The key thing is that the format is a hybrid: a number expressed as a string, re-expressed as a "number" (a fake one). It turns out to be better to parse it as a string from the start. This avoids floating-point rounding errors, so that you wind up with the same "number" you started with.

The query handles either "." or "," as decimal separator.

SELECT 

    [Longitude]

    [sgnX] * ([dX] + [mX] / 60 + [sX] / 3600) AS [DDx],

    [Latitude]

    [sgnY] * ([dY] + [mY] / 60 + [sY] / 3600) AS [DDy]

FROM

    (SELECT

        [Longitude][sgnX],

        CAST(Left([dmsX][dotX] - 1) AS DOUBLEAS [dX],

        CAST(Mid([dmsX][dotX] + 1, 2) AS DOUBLEAS [mX],

        CAST(Right([dmsX], Len([dmsX]) - [dotX] - 2) AS DOUBLE) / 10000 AS [sX],

        [Latitude][sgnY],

        CAST(Left([dmsY][dotY] - 1) AS DOUBLEAS [dY],

        CAST(Mid([dmsY][dotY] + 1, 2) AS DOUBLEAS [mY],

        CAST(Right([dmsY], Len([dmsY]) - [dotY] - 2) AS DOUBLE) / 10000 AS [sY]

    FROM

        (SELECT

            [Longitude][sgnX][dmsX],

            MAX(InStr([dmsX]"."), InStr([dmsX]",")) AS [dotX],

            [Latitude][sgnY][dmsY],

            MAX(InStr([dmsY]"."), InStr([dmsY]",")) AS [dotY]

        FROM 

            (SELECT

                [Longitude],

                SGN([Longitude]AS [sgnX]

                CAST(ABS([Longitude]AS TEXTAS [dmsX],

                [Latitude]

                SGN([Latitude]AS [sgnY],

                CAST(ABS([Latitude]AS TEXTAS [dmsY]

            FROM [Table]

            )

        )

    );

Attachments:
DMS (as number) to DD.txt

spoedniek

328 post(s)
#18-Nov-08 03:09

Just had another idea. If it's only the formatting you want (i.e. exactly 123D 12' 34) you can use a regular expression in the Replace Dialog (Ctl-H with the table open). First make sure the column type is Text. Then open the Replace Dialog and check 'Use regular expressions' and 'Search only in [Column]'. In the 'Find What:' field type in: ([0-9]*)\.([0-9]{2})([0-9]*) and in 'Replace with:' type: $1D $2' $3"

It worked for a small sample, but since the {2} in that regex is quite strict it may bomb out on numbers such as 34.3 where there's only one number after the decimal (something that can happen because Manifold will bring the column in as a Floating Point type and truncate something like 34.3000 to 34.3). It should work for most cases though (he says with way too much confidence )

Henry

0 msec Copyright (C) 2007-2008 Manifold.net. All rights reserved.