Tile image with polygons got vertical line at the edge

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Tile image with polygons got vertical line at the edge

efujioka
Hello experts,

I have a weird problem that Mapserver images get one pixel wide vertical
lines when they contain shapefiles that extend beyond the images
(shapefiles are cut at the edge of the images).

I'm developing a Google Maps application in which Mapserver layers are
overlaid. As Google Map requests tiles of the map image, Mapserver sends
them back. This usually works excellent. But when a tile has a shapefile
extending beyond it, the tile got a kind of border line visible.

Please see the screen shot. You'll see two vertical lines 256-pixel
apart (which is the tile size).
http://seamap.env.duke.edu:8888/dev/cache/misc/tile_edge_lines.jpg


I tried PNG and GIF with the same results. This should have nothing to
do with Google Maps because I still see the line when pulling the tile
image directly onto the browser.
Polygons are added to the map with PHP/Mapscript. Transparency, fill
color and outline color are set.
   $layer->set('transparency',"30");
   ...
   $poStyle = ms_newStyleObj($class_tmp);
   $poStyle->outlinecolor->setRGB(255,0,0);
   $poStyle->color->setRGB(200, 100, 0);

Any workaround?


MapServer version 4.2.2 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP
OUTPUT=PDF SUPPORTS=PROJ SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER
SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT
INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE

Thanks,


Ei


--
======================
   Ei Fujioka
   Research Associate
   Duke University

   (919) 613-8021
   [hidden email]
======================
Reply | Threaded
Open this post in threaded view
|

Re: Tile image with polygons got vertical line at the edge

Stephen Woodbridge
Hello Ei,

Have you looked at ka-map or preferably openLayers? OpenLayers allows
you to easily merge mapserver and Google into a single application and
does all the heavy lifting.

Regarding your extra lines, this is might be cause by the fact that the
polygon is getting clipped to the extents of your tile. You might try
setting the OUTLINECOLOR -1 -1 -1 for the polygon layer so that it is
not draw. I do not think you would run into these problems with OpenLayers.

-Steve W


Ei Fujioka wrote:

> Hello experts,
>
> I have a weird problem that Mapserver images get one pixel wide vertical
> lines when they contain shapefiles that extend beyond the images
> (shapefiles are cut at the edge of the images).
>
> I'm developing a Google Maps application in which Mapserver layers are
> overlaid. As Google Map requests tiles of the map image, Mapserver sends
> them back. This usually works excellent. But when a tile has a shapefile
> extending beyond it, the tile got a kind of border line visible.
>
> Please see the screen shot. You'll see two vertical lines 256-pixel
> apart (which is the tile size).
> http://seamap.env.duke.edu:8888/dev/cache/misc/tile_edge_lines.jpg
>
>
> I tried PNG and GIF with the same results. This should have nothing to
> do with Google Maps because I still see the line when pulling the tile
> image directly onto the browser.
> Polygons are added to the map with PHP/Mapscript. Transparency, fill
> color and outline color are set.
>   $layer->set('transparency',"30");
>   ...
>   $poStyle = ms_newStyleObj($class_tmp);
>   $poStyle->outlinecolor->setRGB(255,0,0);
>   $poStyle->color->setRGB(200, 100, 0);
>
> Any workaround?
>
>
> MapServer version 4.2.2 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP
> OUTPUT=PDF SUPPORTS=PROJ SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER
> SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT
> INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE
>
> Thanks,
>
>
> Ei
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Tile image with polygons got vertical line at the edge

efujioka
Thanks Steve,

Unfortunately, OUTLINECOLOR -1 -1 -1 doesn't work. It seems the vertical
line gets the color of the polygon fill color, not outline color.

Yes, I have been looking into OpenLayers. It's a interesting project but
not yet mature enough to build full-featured online mapping application
(producing legend, changing symbol color on the fly, identify, filter by
attributes etc.).

Anyway, I gave it a try. But the same results. See the screen shot.

http://seamap.env.duke.edu:8888/dev/cache/misc/tile_edge_lines_ol.jpg


As I said, I see the line when I directly get the image from Mapserver,
suggesting this is a problem of Mapserver itself.

Both OpenLayers.Layer.MapServer and Google Map's GTileLayer simply grab
images from Mapserver. In this regard, it is understandable that both
end up with the same results.

Ei


Stephen Woodbridge wrote:

> Hello Ei,
>
> Have you looked at ka-map or preferably openLayers? OpenLayers allows
> you to easily merge mapserver and Google into a single application and
> does all the heavy lifting.
>
> Regarding your extra lines, this is might be cause by the fact that the
> polygon is getting clipped to the extents of your tile. You might try
> setting the OUTLINECOLOR -1 -1 -1 for the polygon layer so that it is
> not draw. I do not think you would run into these problems with OpenLayers.
>
> -Steve W
>
>
> Ei Fujioka wrote:
>> Hello experts,
>>
>> I have a weird problem that Mapserver images get one pixel wide
>> vertical lines when they contain shapefiles that extend beyond the
>> images (shapefiles are cut at the edge of the images).
>>
>> I'm developing a Google Maps application in which Mapserver layers are
>> overlaid. As Google Map requests tiles of the map image, Mapserver
>> sends them back. This usually works excellent. But when a tile has a
>> shapefile extending beyond it, the tile got a kind of border line
>> visible.
>>
>> Please see the screen shot. You'll see two vertical lines 256-pixel
>> apart (which is the tile size).
>> http://seamap.env.duke.edu:8888/dev/cache/misc/tile_edge_lines.jpg
>>
>>
>> I tried PNG and GIF with the same results. This should have nothing to
>> do with Google Maps because I still see the line when pulling the tile
>> image directly onto the browser.
>> Polygons are added to the map with PHP/Mapscript. Transparency, fill
>> color and outline color are set.
>>   $layer->set('transparency',"30");
>>   ...
>>   $poStyle = ms_newStyleObj($class_tmp);
>>   $poStyle->outlinecolor->setRGB(255,0,0);
>>   $poStyle->color->setRGB(200, 100, 0);
>>
>> Any workaround?
>>
>>
>> MapServer version 4.2.2 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP
>> OUTPUT=PDF SUPPORTS=PROJ SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER
>> SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT
>> INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE
>>
>> Thanks,
>>
>>
>> Ei
>>
>>
>
>

--
======================
   Ei Fujioka
   Research Associate
   Duke University

   (919) 613-8021
   [hidden email]
======================