What is Google Earth CoordSys in MapInfo

1,435 views
Skip to first unread message

Una B.

unread,
Jun 14, 2018, 7:26:21 AM6/14/18
to MapInfo-L
Hello, 

I'm trying to update "Long" and "Lat" columns in my TAB with point objects, by using this MapBasic statement: 


Update myPointTable Set long = CentroidX(obj)
Update myPointTable Set lat = CentroidY(obj)

Without defining my coordinate system (MapInfo is always using WGS84, and defined projection determines objects in local CS), I am getting coordinates that are shifted by cca 390 m east, and something small to the north. Then I tried setting different CS (Set CoordSys Earth, Set Map XY Units "degree" CoordSys Earth Projection 1, 33 , "  , "Popular Visualization CRS\p3857", 10, 157, 7, 0.....) but they all return same result. 

When I import TAB in to QGIS, and save as KML with [EPSG:4326 - WGS84] I get correct coordinates, so my best guess is that I need to set correct coordinate system, but I don't which one it is. I have searched this forum, and googled it but none of solution worked for me.


Thank you, 

Una




Warren Vick

unread,
Jun 14, 2018, 9:39:39 AM6/14/18
to mapi...@googlegroups.com

Hello Una,

 

Offsets of that order of magnitude are usually down to an incorrect coordinate system. It’s best to explicitly set the one you need. Here’s an example of setting Lat/Lon WGS-84 and updating both of your fields in a single update.

 

set coordsys earth projection 1, 104

update myPointTable set Lat = centroidy(obj), Lon = centroidx(obj)

 

Hope that helps.

 

Regards,

Warren Vick

--
--
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, go to:
http://groups.google.com/group/mapinfo-l/subscribe?hl=en
For more options, information and links to MapInfo resources (searching
archives, feature requests, to visit our Wiki, visit the Welcome page at
http://groups.google.com/group/mapinfo-l?hl=en

---
You received this message because you are subscribed to the Google Groups "MapInfo-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapinfo-l+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Una B.

unread,
Jun 14, 2018, 3:45:26 PM6/14/18
to MapInfo-L
Hello Warren, 

Thank you for your reply. It looks like your solution returns correct coordinates. 

However, I don't understand why it doesn't work when I leave out coordinate system (leave it default to WGS84), even using  "Popular Visualization CRS\p3857" (where 3857 should represent EPSG code, and according to https://epsg.io/3857 it's: WGS 84 / Pseudo-Mercator -- Spherical Mercator, Google Maps, OpenStreetMap, Bing, ArcGIS, ESRI, so it should fit perfectly)

college.atlas

unread,
Jun 15, 2018, 2:20:15 AM6/15/18
to MapInfo-L
Una,
This might help with why you're having trouble. 


Particularly Alistair Aitchison's discussion regarding the "Popular Visualization" which appears with the note

“It is not a recognised geodetic system”

Warren Vick

unread,
Jun 15, 2018, 6:06:45 AM6/15/18
to mapi...@googlegroups.com

Hello Una,

 

I can’t remember what Pro’s default is, but it could well be LL.WGS-84 (EPSG: 4326). Web Mercator (or Popular Visualization) with EPSG:3857 is something different. While it uses one axis element from WGS-84, it is a spherical model of the world with a Mercator projection applied. The results are usually in metres. Even when expressed in degrees, you will get different values between the two. As I said, it’s best to explicitly state what you need rather than rely on a default.

 

Regards,

Warren Vick

--

Eric Blasenheim

unread,
Jun 15, 2018, 2:30:56 PM6/15/18
to MapInfo-L
Adding to what Warren said, the set coordsys statement is "context" specific to either your mapbasic program or Pro globally. so if you do what he said in the mapbasic window or in a mapbasic program it will work. But you can't set the coordsys in the mapbasic window and have it impact your mapbasic program, or vice versa. 

However, your statement about setting the coordinate system to Popular Mercator is baffling. If you do that correctly and then ask for Centroid values (or any other spatial values) they will be converted from whatever they are in the data to Popular Mercator. Which would mean that a Long/Lat value in the range of -180/-90 to 180/90 would be converted to meters and be a very large number. (Yes, the X/Longitude value will not be AS big in the UK. ). But the numbers will be way off.  You can query the current coordinate system. using SessionInfo(1)

Regards,
Eric Blasenheim
Pitney Bowes Software

Eric Blasenheim

unread,
Jun 15, 2018, 2:54:58 PM6/15/18
to MapInfo-L
Una,

As Warren says, Popular Visualization is its own projection. The coordinates we return for it are always in meters, as I mentioned earlier. 

Try this test.

Start Pro and go to the Options dialogs and under Map Preferences there is a Projection tab. That has a button for Session vs Table projection. Table only has to do with the default when creating new data. Click on Session
The normal projection dialog will come up showing you the current "system projection". Unless you have changed it, the display should show Longitude/Latitude (WGS84) with EPSG code 4326.

Open a sample map like World Capitals and click on Washington DC or anything not near the equator and Prime Meridian.  You can put bing behind it if you like or turn labels on. But having a point to click on is easier to explain.

Open the MapBasic window and enter this:
print Centroidx(selection.obj) + "," + CentroidY(selection.obj)

Assuming the point is selected pressing Enter anywhere on that line will work.  
For Washington d.c. I get these results

-76.9538,38.8909


Now go back to the Options for Map Window and change the session projection to Popular Visualization. It is under the "Projections of the world" category near the bottom. You can also do the same thing via the Set Coordsys command in the mapbasic window. Your choice.


OK the change and go back to the mapbasic window and just reenter the command. 


I get this:

-8566460.85,4706057.82

which are the meters from the Prime Meridian and from the equator in this projection. 
That is why any values that are in degrees used under this coordsys will basically result in data that is 0.0 as even 180 meters is basically 0. The coordinate space of Popular Visualization is just over 40 million meters in each direction (20 million positive and negative).


On Thursday, June 14, 2018 at 7:26:21 AM UTC-4, Una B. wrote:
Reply all
Reply to author
Forward
0 new messages