[mapserver-users] Transparent lines at -180 when rendering BlueMarble data

Jason Beverage jasonbeverage at gmail.com
Sun Jan 10 20:49:52 EST 2010


Hi all,

I figured out what the issue was, but I'm not sure I understand why it
causes the transparent pixels.

Originally, when I created my mapObj in Python, I was initializing the map's
projection to a geographic projection with:
m.setProjection("init=epsg:4326")

The issue goes away if I initialize the map using a PROJ string instead:
m.setProjection("+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs")

The really strange thing is that the proj string is the exact definition of
EPSG 4326, so the result of both calls should be equivalent.  When I add my
layers to the map, I'm setting their projection with setWKTProjection and
passing in their WKT strings stored in a database, and both the map and the
layer (BlueMarble) should have the same projection.  It's almost as if by
setting the map's projection with an EPSG code makes Mapserver think it
needs to reproject the data even though it doesn't.

Any thoughts on why this would occur?

Thanks!

Jason



On Thu, Dec 31, 2009 at 6:22 PM, Jason Beverage <jasonbeverage at gmail.com>wrote:

> Hi Steve,
>
> I thought of that too, but even the Introduction to MapServer page (
> http://mapserver.org/introduction.html) uses -180 -90 180 90 to render the
> BlueMarble data at full extent so that seems like it shouldn't be the case.
> I'll keep on testing and see what I can come up with.
>
> Thanks,
>
> Jason
>
>
> On Wed, Dec 30, 2009 at 11:40 PM, Lime, Steve D (DNR) <
> Steve.Lime at state.mn.us> wrote:
>
>> I wonder if it's due to differences in the extent models. GDAL uses
>> edge-to-edge (I believe) meaning that the extent represents the outer edge
>> of the UL and LR pixels in the image. MapServer uses a center-to-center
>> model where the extent represents the pixel centers of the UL and LR pixels.
>> The software itself takes these differences into account and you might need
>> to as well as you compute extents. So, when you set an extent with minx at
>> -180, MapServer has the center of it's left-hand edge pixels at -180, but in
>> GDAL that's the left-hand edge of the left-hand edge pixels. Rounding error
>> could account for the blank column.
>>
>> I'd convert your GDAL extent to a MapServer extent (I can help with this
>> if necessary) and then chop things up based on that. Make sense?
>>
>> Steve
>>
>> ________________________________________
>> From: mapserver-users-bounces at lists.osgeo.org [
>> mapserver-users-bounces at lists.osgeo.org] On Behalf Of Jason Beverage [
>> jasonbeverage at gmail.com]
>> Sent: Monday, December 28, 2009 1:27 PM
>> To: mapserver-users
>> Subject: [mapserver-users] Transparent lines at -180 when rendering
>> BlueMarble data
>>
>> Hi all,
>>
>> I'm using mapscript to render some blue marble data into tiles.  The issue
>> I'm seeing is that occasionally I get a 1pixel wide transparent column along
>> -180 at different zoom levels.  For example, if I render a 256x256 tile by
>> setting the map's extent using:
>> map.setExtent (-180.0, -22.5, -157.5, 0.0)
>>
>> I'm getting the attached image with the transparent column.
>>
>> The extent of the file itself via gdalinfo is -180,-90,180,90 so it does
>> cover the whole world and there are no transparent pixels in the data
>> itself.
>>
>> Thanks!
>>
>> Jason
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20100110/1ea7f6b3/attachment-0001.html


More information about the mapserver-users mailing list