[mapserver-users] Trouble with mode=tile

Dave Rafkind drafkind at traversetechnologies.com
Fri Jan 2 13:20:28 PST 2009


Ahh, image hosted here:

http://farm4.static.flickr.com/3115/3161140430_b1577f81bf_o.jpg

Dave Rafkind wrote:
> Hi, thanks for your reply. Results follow:
>
> I can't remove the PROJECTION block, otherwise I get this error from 
> mapserver:
> msTileSetProjectionst(): WMS server error. Cannot set new SRS on a map 
> that doesn't have any projection set. Please make sure your mapfile 
> has a PROJECTION defined at the top level.
>
> QGis thinks this is the spatial information for my test shapefile, 
> this is 4326 (basically unprojected), right?
> +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs
>
> If I have the PROJECTION block in the mapfile, I can indeed see tiles 
> of some kind, but it looks like each tile overlaps in its spatial extent.
>
> See attached for "wrong" results..I changed some of the colors so it 
> would be more obvious.
>
>
>
>
> Paul Ramsey wrote:
>> Dave,
>>
>> - Remove the PROJECTION block from the MAP level (leave the one at the
>> LAYER level). Tile mode constructs its own output projection object,
>> it doesn't need map file configuration for the output projection, just
>> the inputs.
>> - Confirm that the shape file you are using *is* in fact epsg:4326
>> - Try manually accessing the service using tile=0 or tile=1, and see
>> what comes back
>> - Show some pictures of "wrong" in your next mail
>>
>> P.
>>
>> On Fri, Jan 2, 2009 at 12:06 PM, Dave Rafkind
>> <drafkind at traversetechnologies.com> wrote:
>>  
>>> Thanks for the suggestions, but I don't think that's quite it:
>>>
>>> 1 - removing "epsg:4326" from the wms_srs part of the mapfile didn't 
>>> fix it
>>> 2 - adding "&SRS=EPSG:900913" to the Virtual Earth "tileSource" string
>>> didn't fix it
>>>
>>> Is there anything else I can try?
>>>
>>>
>>> Fawcett, David wrote:
>>>    
>>>> Dave,
>>>> I am not sure if this is it, but in your WMS request, you are not
>>>> specifying a SRS.  You are advertising two SRS' in your WEB WMS
>>>> "wms_srs" metadata.  I wonder if MapServer is just defaulting to the
>>>> first SRS in your list in the absence of an explicit request?
>>>> David.
>>>>
>>>> -----Original Message-----
>>>> From: mapserver-users-bounces at lists.osgeo.org
>>>> [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Dave
>>>> Rafkind
>>>> Sent: Friday, January 02, 2009 12:39 PM
>>>> To: mapserver-users at lists.osgeo.org
>>>> Subject: [mapserver-users] Trouble with mode=tile
>>>>
>>>>
>>>> Hi list, I'm using the latest ms4w on a windows XP box. When trying 
>>>> to use
>>>> mapserver's tile mode in a Virtual Earth or Google Maps control, it
>>>> looks totally wrong (like the wrong projection is being used 
>>>> perhaps?).
>>>> What is the right way to go about this?
>>>>
>>>> Here's mapserver.exe -v:
>>>>
>>>> C:\ms4w\Apache\cgi-bin>mapserv -v
>>>> MapServer version 5.2.1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP
>>>> OUTPUT=PDF
>>>>  OUTPUT=SWF OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE
>>>> SUPPORTS=ICO
>>>> NV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT
>>>> SUPPORTS=WFS_SERVER
>>>> SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER
>>>> SUPPORTS=FASTCGI SUP
>>>> PORTS=THREADS SUPPORTS=GEOS SUPPORTS=RGBA_PNG INPUT=JPEG INPUT=POSTGIS
>>>> INPUT=OGR
>>>>  INPUT=GDAL INPUT=SHAPEFILE
>>>>
>>>> Here's the relevant part of my web page with the map control:
>>>>        map=new VEMap('myMap');
>>>>        // ...
>>>>        var layerId = "myCustomTileLayer";
>>>>        var tileSource =
>>>> "http://localhost/cgi-bin/mapserv.exe?map=/src/maps/mapdata/maps/dave1.m 
>>>>
>>>> ap&layers=world&mode=tile&tilemode=ve&tile=%4";
>>>>        var tileSourceSpec = new VETileSourceSpecification(layerId,
>>>> tileSource);
>>>>        // ...
>>>>
>>>> Here's the last line of my EPSG file (from c:\ms4w\proj\nad\epsg)
>>>>        # google/virtual earth spherical mercator
>>>>        <900913> +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 
>>>> +lon_0=0.0
>>>>
>>>> +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs <>
>>>>
>>>>
>>>> And here's my map file:
>>>> MAP
>>>>  IMAGETYPE      PNG
>>>>  OUTPUTFORMAT
>>>>    NAME png
>>>>    DRIVER "GD/PNG"
>>>>    MIMETYPE "image/png"
>>>>    IMAGEMODE RGBA
>>>>    EXTENSION "png"
>>>>    TRANSPARENT ON
>>>>  END
>>>>
>>>>  SHAPEPATH      "/src/maps/mapdata"
>>>>  FONTSET     "/src/maps/mapdata/fonts.list"
>>>>  IMAGECOLOR     0 0 0
>>>>
>>>>    WEB
>>>>  METADATA
>>>>    "wms_title"           "WMS Demo Server"
>>>>    "wms_onlineresource"
>>>>  "http://localhost/cgi-bin/mapserv.exe?map=/src/maps/mapdata/maps/dave1.m 
>>>>
>>>> ap&"
>>>>    "wms_srs"             "EPSG:4326 EPSG:900913"
>>>>  END
>>>> END
>>>>
>>>>      PROJECTION
>>>>      "init=epsg:900913"
>>>>    END
>>>>
>>>>  SYMBOL
>>>>    name "circle"
>>>>    type ellipse
>>>>    filled true
>>>>    POINTS 1 1 END
>>>>  END
>>>>
>>>>  SYMBOL
>>>>    NAME 'dashed1'
>>>>    TYPE ELLIPSE
>>>>    POINTS 1 1 END
>>>>    FILLED true
>>>>    STYLE 4 4 END
>>>>  END
>>>>
>>>>  SYMBOL
>>>>    NAME 'railway'
>>>>    TYPE cartoline
>>>>    LINECAP butt
>>>>    LINEJOIN miter
>>>>    LINEJOINMAXSIZE 3
>>>>    STYLE
>>>>      1 10 1 10
>>>>    END
>>>>  END
>>>>
>>>>  LAYER
>>>>    PROJECTION
>>>>      "init=epsg:4326"
>>>>    END
>>>>    NAME         world
>>>>    DATA     "world/world_adm0.shp"
>>>>    STATUS OFF
>>>>    TYPE         LINE
>>>>    LABELITEM     "REGION"
>>>>    CLASS
>>>>      STYLE
>>>>                COLOR 255 255 255
>>>>                OUTLINECOLOR 0 0 0
>>>>      END
>>>>      LABEL
>>>>        COLOR 0 0 0
>>>>        OUTLINECOLOR 255 255 255
>>>>        TYPE TRUETYPE
>>>>        FONT arial
>>>>        SIZE 9
>>>>        ANTIALIAS TRUE
>>>>        PARTIALS FALSE
>>>>        MINDISTANCE 250
>>>>        BUFFER 4
>>>>      END
>>>>    END
>>>>  END
>>>> END
>>>>
>>>>
>>>> _______________________________________________
>>>> mapserver-users mailing list
>>>> mapserver-users at lists.osgeo.org
>>>> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>>>>
>>>>       
>>> _______________________________________________
>>> mapserver-users mailing list
>>> mapserver-users at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>>>
>>>     
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users




More information about the MapServer-users mailing list