[mapserver-users] raster creation & use

Ed McNierney ed at topozone.com
Tue May 7 13:40:06 EDT 2002


Joe -

I was just scratching my head over your previous email (with the MAP file info) and I'm glad I took the time to read this one <g>.  I'm sorry we didn't catch it faster, but I'm glad you're back on track.  If you specify "impossible" coordinates for the extents of a map image, MapServer will try to do the best fit it can, and you don't always get what you expect!

	- Ed

-----Original Message-----
From: Joe Bussell [mailto:joe at otsys.com]
Sent: Friday, May 03, 2002 5:42 PM
To: Joe Bussell
Cc: Stephen Woodbridge; Joe Bussell; mapserver-users at lists.gis.umn.edu
Subject: Re: [mapserver-users] raster creation & use


Looks like I found the problem.  I declared the following:

$right = $map->{extent}->{maxx};
$left = $map->{extent}->{minx};
$top = $map->{extent}->{miny};
$bottom = $map->{extent}->{maxy};
             
my $xPixelSize = ($right - $left) / $args{XDIM};
my $yPixelSize = -($bottom - $top) / $args{YDIM};

makeWldFile(    DEST_FILE       => $wldFile,
                X_PIXEL_SIZE    => $xPixelSize,
                Y_PIXEL_SIZE    => $yPixelSize,
                X_ROT           =>  0,
                Y_ROT           =>  0,
                LEFT            =>  $left,
                TOP             =>  $top     );

See the problem?  $top has been given the value for the bottom of the
map.  I missed this one.  Sorry to have bugged you folks, but the right
questions were asked which resulted in quicker debug time.  Many thanks
for all the considered replies.

Joe Bussell
On Time Systems



On Fri, May 03, 2002 at 12:11:10PM -0700, Joe Bussell wrote:
> Greetings,
>     The main goal here is to speed up map production for our site by
> precomputing everything that we can.  We have map data for the area that
> we are interested, and maps generated on the fly from the source data
> are produced quite nicely.  The trouble is that it is heinously slow to
> render all the street map stuff, which we then paint on top of.  The
> plan was to pregenerate a set of tiles for use as a raster layer, thus
> speeding production of the maps.
> 
>    The tiled layers do not display properly.  I believe that the issue
> is primarily one of shift.  As the level increases, the shift becomes
> better.  Lower levels produce shifts South about 0.5 degree.
> 
>    My projection statement in the map file which drives the generation
> of these tiles is the same as where I use it:
> PROJECTION
>     "proj=latlong"
> END
> 
>    I have tested the site as you suggested which has led me to believe
> that the layers are shifted down, more so for the lower levels of zoom
> (in my world that means zoomed way out, maximum area coverage).
> 
> Cordially,
> 
> Joe Bussell
> On Time Systems
> 
> 
> 
> On Fri, May 03, 2002 at 02:44:10PM -0400, Stephen Woodbridge wrote:
> > Joe,
> > 
> > Can you step back from the detailed problems for a minute, I want to
> > make sure I haven't lost the big picture of what you are trying to do.
> > 
> > IIRC, you are trying to generate base map images using mapserver.  By
> > capturing the png? images produced by mapserver and creating .wld files
> > for the images, then trying to get these tiled and lined up with your
> > mapserver again.
> > 
> > Is that correct? (or more likely just confused :)
> > 
> > Ignore the rest if my assumption is wrong about:
> > 
> > What is the output projection of mapserver? 
> >   (ie: your PROJECTION ... END section at the top of your map file.)
> > 
> > How are you stepping across the extents of your data to generate these
> > tiles?
> > 
> > How are the images mis-aligned? too big, too small, skewed, offset or
> > shifted up, down, left, right, or some of all of these or your not sure.
> > 
> > Have you tried to make one tile and bookmark the location where you made
> > the tile, then add a layer for the one tile with its, .wld file and go
> > back to the book marked url and see how the align/sizing is?
> > 
> > You seem to have too many variables in play right now, like is the
> > problem with the tile generation, the wld file creation, tile index,
> > mapserver layer definition, etc, etc, etc. You need to simplify the
> > problem so that we can identify the issue at its source.
> > 
> > -Steve



More information about the mapserver-users mailing list