Does any one know why the MapBasic command "Save Window" does not
honour the map extents when saving a Map Window to an image?
I've gone over this for 2 days now and have all my map scale and map
centre parameters correct, but when I save window to a BMP I get a map
that's over 100m off.
You can test it by setting the map centre and zoom/scale manually and
then going into MI Pro and Saving the map window with a georeferenced
table. The coordindates in the TAB file are wider than the map
extents you had set...!!?!
Anyone have any ideas on a workaround? We can't output images with a
100m error in them...
Cheers,
Hugh
I can think of two possibilities:
1. You have the scrollbars on in your map window. these don't get saved
with the image but the window size includes them so you get more than
you expect and the centre gets "shifted" to the left and up.
2. Some of the layers in your map belong to tables with different
projections, some of which are less accurate. But it's unlikely MapInfo
would "reproject" when saving thus producing the error.
Cheers,
Jorge
_________________
Jorge Gil
Associate, Research & Development
SPACE SYNTAX
D +44 (0) 20 7422 7611
j....@spacesyntax.com
www.spacesyntax.com
Using MapperInfo allowed me to determine how far off MapInfo was and
adjust the map width to suit...
FYI - If you set a map to be 500m wide: Mapperinfo will tell you it's
500m wide, but using it to determine MAXX and MINX will tell you it's
actually 500m + The MapInfo Bodge Factor (officially known as the
MBF).
For my 12 inch wide map window - the error was ~100m (i.e. 20%). 8^(
Cheers,
Hugh
I'm guessing that you could calculate the corner coordinates yourself
and set them in Mapbasic, and then save the window regardless of what
you actually see on screen ????
Does that work?
Gentreau.
> > Philwww.philallen.net- Hide quoted text -
>
> - Show quoted text -
Not sure if it will make any difference but there's the option to set
the aspect ratio of the screen, which can be found in the System
Settings Preferences dialog (under Options -> Preferences).
Greg Driver
System Administrator
Applications Support
ICT
NOT PROTECTIVELY MARKED
I tried this out and got a tiny error.
I set the window for 500m wide and saved it and the tab file was as
follows:
Definition Table
File "500m.bmp"
Type "RASTER"
(311916.79442093958,2192786.2647388875) (0,0) Label "Pt 1",
(312416.73437923013,2192786.2647388875) (1400,0) Label "Pt 2",
(311916.79442093958,2192477.3732646583) (0,865) Label "Pt 3"
That is a window width or 499.94 m which seems good enough to me!
(0.012% error)
I am using a French Lambert II (metre) projection.
MapInfo 8.5.1B
My Map options are:
Coordinates metres
Distance km
Area sq km
Hth
Gentreau
I am curious about your tab file. It indicates that you had an image 1401
pixels wide; you have a 0th and a 1400th pixel. If you check with "Paint",
is that correct?
In the dim and distant past I wrote an MBX to save a mapper window as a jpg
with a jgw (so arcaic users could open a registered image) and I ran into
the same problem. The problem then was the height and width of the bitmap in
pixels which is needed to set up the tab file. In MB I calculated the width
and height of the mapper window, recovered the dpi value from system metrics
and used that to determine the pixel sizes. If you use the mapbasic window
command set window frontwindow() width 5, height 5 (assuming inches), and
use a plastic ruler to measure the window on the screen, you don't get a
5"x5" square, so when you centre and scale, ready to save, you may well not
be looking at a correct image.
As an aside, if you use the edit menu copy window (when nothing is selected)
and open Paint, paste it in and look at image attributes, you can get the
image sizes in pixels or inches etc.
I concluded that I could only produce an approximate picture; good enough to
show the area, but not quite good enough to measure position from.
T
----- Original Message -----
From: "Gentreau" <goo...@gentreau.com>
To: "MapInfo-L" <mapi...@googlegroups.com>
Sent: Thursday, September 20, 2007 3:57 PM
Subject: [MI-L] Re: MapBasic: Save Window Inaccuracy
>
As Tony, I have programmed a MBX to export a bitmap from a mapper window
including a .lwd file with coordinate information for the bitmap. It
produces files that can be used as background map in a trimble GPS unit
(or in ArcView). I can - very, very dimly - remember som disprenancies
regarding the world coordinates for the bitmap. IIRC the mapper window
must not be maximized when you export the bit-map file-pair. I've
attached the MB file and a INI file. Extract both to the same directory
and compile the mb.
I added some code to generate a .tab file with registration parameters
for the generated bit-map. The mbx will now produce 3 files: the bitmap
file, a . lwd file with trimble paramters and a .tab file with MI
parameters.
Regards
Bo Thomsen
GeoConsult I/S
Denmark
Hugh skrev: