Odd Layer Cutoff

Peter Kuc-Pittet kucpittetp at AGR.GC.CA
Thu Aug 25 15:26:35 EDT 2005


I had shapefiles of grids which I used shp2pgsql.exe to import into my
Postgres database.  They worked and were displayed properly.  Then I
noticed that the grid was off by 10000m (it is in UTM).  The original
shapefile was created 10000m further north than it should have been, so
this was simply an error in the initial creation of the shapefile.

In order to move the grid into the proper position, I ran the following
query in postgres.

update geom_mapbooksheet set the_geom = translate(the_geom, 0, -10000, 0);

The grid shifted down 10000m as expected, but now the layer is not
displayed if it is within 10000m of the top of the viewable area.

Here is a poorly rendered ascii picture of the problem. ( = means image
border, - and | are gridlines.

Before

==========================================
=  |   |   |   |   |   |   |   |   |   | =
=  |   |   |   |   |   |   |   |   |   | =
=----------------------------------------=
=  |   |   |   |   |   |   |   |   |   | =
=  |   |   |   |   |   |   |   |   |   | =
=  |   |   |   |   |   |   |   |   |   | =
=  |   |   |   |   |   |   |   |   |   | =
=----------------------------------------=
=  |   |   |   |   |   |   |   |   |   | =
=  |   |   |   |   |   |   |   |   |   | =
=  |   |   |   |   |   |   |   |   |   | =
=  |   |   |   |   |   |   |   |   |   | =
=----------------------------------------=
=  |   |   |   |   |   |   |   |   |   | =
==========================================

After

==========================================
=                                        =
=                                        =
=----------------------------------------=
=  |   |   |   |   |   |   |   |   |   | =
=  |   |   |   |   |   |   |   |   |   | =
=  |   |   |   |   |   |   |   |   |   | =
=  |   |   |   |   |   |   |   |   |   | =
=----------------------------------------=
=  |   |   |   |   |   |   |   |   |   | =
=  |   |   |   |   |   |   |   |   |   | =
=  |   |   |   |   |   |   |   |   |   | =
=  |   |   |   |   |   |   |   |   |   | =
=----------------------------------------=
=  |   |   |   |   |   |   |   |   |   | =
==========================================

Note that the grid up top in the 'after' pic exists, and if I pan upwards
it will be drawn.  But the next section of grid that would be within 10000m
of the top of the images is now cut off.  If I shift it up 10000m the exact
same behavior is repeated, except now the botton is cut off.

I have no ideas, and hope that someone here does.

 -- Peter



More information about the mapserver-users mailing list