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.

Reply via email to