[MI-L] Lat/Long Centroid Rounding

789 views
Skip to first unread message

P&D_GIS

unread,
May 19, 2010, 2:57:24 PM5/19/10
to MapInfo-L
Hello,
I need to get centroid positions for a long point file in Lat/Long
(WGS84) coordinates that are accurate to 5 or 6 decimal places. The
coordinate extractor tool seems to automatically round the lat/long
positions to four decimal places. How can I get more accurate
positions?

Any advice would be appreciated.

--
You received this message because you are subscribed to the
Google Groups "MapInfo-L" group.To post a message to this group, send
email to mapi...@googlegroups.com
To unsubscribe from this group, send email to mapinfo-l+...@googlegroups.com
For more options, information and links to MapInfo resources (searching archives,
posting feature requests, to visit our Wiki, visit the Welcome page at http://groups.google.com/group/mapinfo-l?hl=en

Spencer Simpson

unread,
May 19, 2010, 4:35:24 PM5/19/10
to mapi...@googlegroups.com

That may just be the default number-to-string conversion -- the actual
coordinate values in the columns may have greater precision.

You generally have to use Format$() to see a specific

Where are you seeing 4 decimal places? In a browser? In the Info Tool?

IF so, then use Format$(coord_col, "0.#######") instead of coord_col by
itself. You may see the extra decimals you want.

If you put coordinate values into Decimal columns with the desired number of
decimal places instead of Float columns, this will change the display string
conversion for those columns.

________________________________

Spencer

SMITH,Stephen (ACT)

unread,
May 19, 2010, 7:11:29 PM5/19/10
to mapi...@googlegroups.com
I would change the table structure of the Long & Lat fields from float to Decimal(11,6) so that the required decimal places are visible in the browser windows.

Regards

Steve Smith
Geospatial Data Development
Research Branch
Social Policy Group
Dept of Education Employment and Workplace Relations
email:- Stephen...@DEEWR.gov.au
Wk:- (02) 6240-9048
Location Code:- C14MT1
Level 1 / 14 Mort St Canberra City Act 2601
GPO Box 9880 Canberra Act 2601


-----Original Message-----
From: mapi...@googlegroups.com [mailto:mapi...@googlegroups.com] On Behalf Of P&D_GIS
Sent: Thursday, 20 May 2010 4:57
To: MapInfo-L
Subject: [MI-L] Lat/Long Centroid Rounding

Hello,
I need to get centroid positions for a long point file in Lat/Long
(WGS84) coordinates that are accurate to 5 or 6 decimal places. The
coordinate extractor tool seems to automatically round the lat/long
positions to four decimal places. How can I get more accurate
positions?

Any advice would be appreciated.


Notice:

The information contained in this email message and any attached files
may be confidential information, and may also be the subject of legal
professional privilege. If you are not the intended recipient any use,
disclosure or copying of this email is unauthorised. If you received this email
in error, please notify the sender by contacting the DEEWR Switchboard on 13 33
97 (1DEEWR) during business hours (8am - 8pm AEST) and delete all copies of
this transmission together with any attachments.

Spencer Simpson

unread,
May 21, 2010, 12:01:46 PM5/21/10
to mapi...@googlegroups.com
I am not experiencing the problem you are describing -- The coordinate
extractor gives me 6 decimal places. So first, let's verify you're really
not getting 6 decimal places.

Try the following commands in the MapBasic window:

Select format$(centroidX(obj),"#.000000000000") "CentLon",
format$(centroidY(obj),"#.000000000000") "CentLat"
from mytable into Selection
Browse * From Selection

Browse format$(lon_column,"#.000000000000") "Lon",
format$(lat_column,"#.000000000000") "Lat" from mytable

Substitute 'mytable' with your table name, 'lon_column' with your actual
longitude column, and 'lat_column' with your actual latitude column.

What do you see in the browsers?

----

What type of column are you putting the coordinates into? You should really
use only one of the following three:

Char (12 or more)
Float
Decimal (11, 6)

If I look at the source of the Coordinate Extractor tool (this comes with
MapBasic), I notice it uses Format$(x, "#.000000") to format the coordinates
if you've chosen to put coordinates into text columns. This should give you
6 decimal places.

----

You might also have a problem with the coordinate bounds of your table --
MapInfo can only resolve X and Y coordinates to 2^-31 of the corresponding
axis's bounds.

But if this were the case, the table's objects would already contain all of
the coordinate information available. Coordinate precision beyond 4 decimal
places wouldn't actually exist.

I don't really see this happening with plain latitude and longitude. For 360
degrees of longitude, the coordinate resolution comes out to about 1.6 *
10^-7 degrees -- more than enough to get 6 decimal places, with the
occasional rounding error in the sixth place.

So if this problem persists, you have an issue with the way the data is
being collected, or the way it is being entered into the table, or the way
the table is being converted for use after the data is all collected.

What is the native projection of the table?
Note tableinfo (mytable, 29)

Are you using the "Use Non-Native Projection" option of the Coordinate
Extractor?
What projection is the data being collected in?
How is the data being entered into the table?

________________________________

Spencer

-----Original Message-----
From: P&D_GIS [mailto:plisg...@gmail.com]
Sent: Friday, May 21, 2010 9:59 AM
To: Spencer Simpson
Subject: Re: Lat/Long Centroid Rounding

The problem doesn't seem to be so much that I can't see the extra
decimal places as that mapinfo isn't producing the desired number of
decimal places. I have a table with thousands of points in it. I
would like to get the coordinates of these points in decimal lat/long
WGS84. I have tried the extract coordinates tool, which produces only
4 decimal places of data, and I've tried an SQL using Centroid_x,
Centroid_y, but I get the same result. It isn't so much an issue of
being unable to see the desired decimal places so much as they just
aren't there to be seen. I can get more exact coordinates by using
UTM, NAD83 for example and then I could convert them to Lat/Long WGS84
outside of MapInfo, but that is a pain. It seems like there should be
simple solution in Mapinfo, I just don't know how to do it... i don't
know much about writing in Map Basic so I would like a solution that
uses point and click tools if thats possible???

Any thoughts?

cheers,
J
Reply all
Reply to author
Forward
0 new messages