projection problem

Serkan Girgin girgink at GMAIL.COM
Fri Dec 16 14:51:14 EST 2005

Hi Frank,

I checked the vertices and the problem is exactly as you guessed, raster and
polygon are matching at the vertices. I will try to add more vertices to the
polygon layer to solve the problem, thank you very much! By the way, this
problem should always be the case if projections of map and data are
different from each other, isn't it? Normally I would expect that on-the-fly
projection algorithms be handling such cases, but as far as I can see this
is not the case. I tried ArcView and it has the same problem too.

Best regards,

Serkan Girgin
girgink at 

-----Original Message-----
From: fwarmerdam at [mailto:fwarmerdam at] On Behalf Of Frank
Sent: Friday, December 16, 2005 4:31 AM
To: Serkan Girgin
Subject: Re: [UMN_MAPSERVER-USERS] projection problem

On 12/15/05, Serkan Girgin <girgink at> wrote:
> Hi!
> I have a problem with on-the-fly projection and I would be grateful if you
> can help me. In my mapfile there is a raster Landsat image in UTM
> (zone 37N) and a shapefile containing a polygon with the same extent of
> raster, again in UTM projection. When I set the overall projection of the
> mapfile to UTM these two layers coincide perfectly as expected (see
> landsat_utm.jpg). But when I change mapfile projection to a different
> projection, e.g. geographic or Lambert Conformal Conic, a shift occurs
> between the layers and they do not coincide (see landsat_lcc.jpg). Do you
> have any idea why this happens? You can find mapfiles that I used below.


I'm not sure from this information, but I would guess that
you get different results because the polygon is only
reprojected at the vertices and then the new polygon is
drawn "straight" between these transformed points.  While
the raster is reprojected for each pixel.  If the polygon is
big enough, this could account for the displacement.

But if this is the case, you should see the polygon match
up closely with the raster as you near one of the vertices of
the polygon.

Best regards,
I set the clouds in motion - turn up   | Frank Warmerdam,
warmerdam at
light and sound - activate the windows |
and watch the world go round - Rush    | Geospatial Programmer for Rent

More information about the mapserver-users mailing list