Hi Jacques, I think it's very importent not to be confused when dealing with this question, since it's both very complex and actually one of MapInfo's strong points, so we better get it straight once and for all. This is what I know:
Basically there are three independent views of coordinate system: 1. The tables themselves (data is physically stored in this coordsys) 2. The mapper windows 3. MBX's, plus the user = the MapBasic window = MapInfo GUI All levels, and all entities on each level, are independent of each other. I.e. you basically don't inherit a coordsys, you set your chosen view. In practice, default setting is made using inheritence, e.g. a new mapper inherits its coordsys from the initial top layer (I think) When you change the coordsys in one entity, as your testing shows, it doesn't affect the coordys in any other entity. I suspect it's much the same with setting XY units seperately, which yours and Bill's testing show. The Change View refers to the mapper window, i.e. an entity in level 2, while the MapperInfo command refers to the level 3 user/gui, NOT the mapper in level 2, as the command's run inside the user/gui environment. However, there's a slight twist to this, I've discovered : when setting the coordsys of a mapper interactively (GUI, not MBW), it changes the user/mbw/gui coordsys too ! This "cross-entity" behaviour was introduced at some point along the way, probably to still the outcries about having to set coordsys manually in the MBW, e.g. to do a Column Update with CentroidX (). But this doesn't show up in your testing, since you haven't tested changing the mapper coordsys with the GUI. I.e., my vote is that this behaviour is a WAD. The only thing that puzzled me in your testing, is that when setting the map coordsys without explicit XY units (MBW Set Map CoordSys Earth Projection 1, 66) the map apparently stays with the previously set XY units (km) instead of adopting the implicit degree units in the set coordsys. But I suspect that this is due to the fact that you've set an explicit XY previously, which overrides later defaults. I wouldn't go as far as to designate this as a bug, since it makes sense in some way. The problem is just that this behaviour is undocumented. Best regards / Med venlig hilsen Lars Nielsen ********************************************************** Lars Nielsen [EMAIL PROTECTED] Sr. Developer, MapBasic & MapXtreme Specialist Kampsax/MapInfo, Odense http://www.mapinfo.dk Authorized MapInfo Distributor in Denmark & Norway Address: Rugaardsvej 55, DK-5000 Odense C Telephone: +45 6313-5000 Facsimile +45 6313-5090 ********************************************************** "Klik ind på http://www.kortal.dk og se det hele lidt fra oven!" "Visit http://www.kortal.dk and see Denmark from above!" ----- Videresendt af Lars Nielsen/Kampsax - 09-01-02 09:16 ----- "Jacques Paris" <[EMAIL PROTECTED]> Til: <[EMAIL PROTECTED]>, "Bill Thoen" <[EMAIL PROTECTED]>, "MIL" Sendt af: <[EMAIL PROTECTED]> [EMAIL PROTECTED] cc: onsmag.com Vedr.: RE: MI-L Set map XY Units bug or WAD? 08-01-02 15:36 Besvar venligst til "Jacques Paris" After each mail on the subject, the problem gets larger. Open MI, open a table with projection TP in a new mapper; let us assume that TP is not a lon/lat but a real projection. (My example, UTM Quebec modified) The mapper will have automatically the projection TP Change view; X center 304700 meters MBWindow (print mapperinfo(frontwindow(),3) -73.5012 degrees Note 1: The MBW uses the MI internally defined coordinate system, by default a plain lon-lat in degrees. MBW set coordsys table my_test_table Change view 304700 meters MBWindow 304670.05 meters MBW set map XY units "km" Change view 304.670 kilometers MBWindow 304670.05 meters Note 2: The change in XY units affects only the mapper "visualization" (everything connected with displaying coordinates) but does not touch the internally stored coordinates MBW Set Map CoordSys Earth Projection 1, 66 Change view -8172.59 kilometers MBWindow -73.5012 degrees Note 3: Surprise: the XY units are not changed in the mapper!!! Changing the projection from the Map | Options | Projection requester would have generated in the MBW Set map XY units "degree" CoordSys Earth Projection 1, 66 MBW Set Map XY units "degree" Change view -73.5012 degrees MBWindow -73.5012 degrees Note 4: Resetting the projection of the mapper will change the way the coordinates are internally stored but will also reset the coordsys of the MBW environment to the new projection which is a surprise as noticed by Peter Any other twist to add to that? Jacques Paris e-mail [EMAIL PROTECTED] MapBasic-MapInfo support http://www.paris-pc-gis.com -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of [EMAIL PROTECTED] Sent: January 8, 2002 01:49 To: [EMAIL PROTECTED] Subject: RE: MI-L Set map XY Units bug or WAD? Hi Bill, Well you sure spooked me here. First when I tried this I couldn't get anything but longitude/latitude coordinates, no matter which unit I used. Then I realized that I had forgotten the most important thing: "Set CoordSys ..." Appearently you'll need to set the coordsys when you try changing the XY units. The Change View tool appearently automatically uses the coordsys/projection from the mapper, but the MapBasic window - or your MapBasic application - uses MapInfos internal coordsys/projection. And appearently when using a longitude/latitude projection you'll allways get your XY units in "degree". One also have to be aware that changing the projection of a mapper tends to confuse MapInfo to use this projection internally as well. I'm not sure whether this is ment to be (WAD) or if it is a bug ?? I hope this sheds some light on this issue, Peter ---------------------------------------------------------------------------- -------------------- Peter Horsbøll Møller, GIS Udviklingskonsulent / GIS-Developer Kampsax A/S - GIS Software & Solutions Rugaardsvej 55, 5000 Odense, DK tel: +45 6313 5013, dir:+45 6313 5008, fax: +45 6313 5090 mailto:[EMAIL PROTECTED] www.kampsax-gis.dk and www.kampsax.dk Authorized MapInfo Partner & Distributor in Denmark and Norway. ---------------------------------------------------------------------------- -------------------- Klik ind på http://www.kortal.dk og se det hele lidt fra oven! Bill Thoen wrote: Here's an odd behavior of MapInfo, and what do mapbasic programmers think? Is this a bug or a WAD (i.e. Works As Designed)? Open any map window (I chose US States) and open the mapbasic window too. Click on the Change View tool button and note the map center X coordinate. Now type into the MB window: Print MapperInfo(FrontWindow(), 3) and press Enter. You should see the same coordinate (3 = MAPPER_INFO_CENTERX). Now type into the MB window: Set Map XY Units "ft" and press Enter. Look at the Change View dialog and notice that the map center coordinates are now in feet (or meters if you tried "m" above.) Now go back to the line in the MB window: Print MapperInfo(FrontWindow(), 3) and put the cursor on it and press Enter. The X coordinate as determined by MapperInfo doesn't change! It's not paying any attention to the Set ... XY Units we told it; instead it's sticking to what was set by the coordsys. But the Change View dialog does use the units we told it. Is this a bug or not? IMHO (and we all know what Humble Opinions are worth) this is a bug. The behavior is inconsistent at best, and in particular, it totally wasted my time, which is of course, unforgivable. Grr. So watch out if you ever try to build a general-purpose map-to-paper units scale converter function. Here be dragons! Or can anyone make a case for it and suggest a work-around? -- - Bill Thoen ------------------------------------------------------------ GISnet, 1401 Walnut St., Suite C, Boulder, CO 80302 tel: 303-786-9961, fax: 303-443-4856 mailto:[EMAIL PROTECTED], http://www.gisnet.com ------------------------------------------------------------ _______________________________________________________________________ List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, send e-mail to [EMAIL PROTECTED] and put "unsubscribe MapInfo-L" in the message body. _______________________________________________________________________ List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, send e-mail to [EMAIL PROTECTED] and put "unsubscribe MapInfo-L" in the message body. _______________________________________________________________________ List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, send e-mail to [EMAIL PROTECTED] and put "unsubscribe MapInfo-L" in the message body. _______________________________________________________________________ List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, send e-mail to [EMAIL PROTECTED] and put "unsubscribe MapInfo-L" in the message body.