[mapserver-users] IIS and mapfiles and also GDAL
Brent Fraser
bfraser at geoanalytic.com
Fri Sep 2 08:28:01 PDT 2011
Chris,
If you have a current version of Mapserver (v5,v6?), then should be
GDAL compiled in. The GDAL library needs to find projection definition
files so I usually include the following in all my map files:
CONFIG "PROJ_LIB" "\ms4w\proj\nad"
CONFIG "GDAL_DATA" "\ms4w\gdaldata"
Another potential problem you may be having is with EPSG:900913. It is
not included in GDAL/PROJ's epsg file so I add the following to
\ms4w\proj\nad\epsg:
<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 <>
Best Regards,
Brent Fraser
On 9/2/2011 9:16 AM, Chris Jackson wrote:
> Hi Brent
>
> Thanks for the quick answers, the new rewriting rules (with reverse
> proxy) have worked well with Tomcat on port 8080 - no more isapi
> dlls! What you listed for Mapnik is essentially like mine, what I am
> not sure is what other GDAL configuration is needed on the box - just
> an environment variable or some other setting in the mapfile...?
>
> Thanks
>
> Chris
>
> On 2 September 2011 16:04, Brent Fraser <bfraser at geoanalytic.com
> <mailto:bfraser at geoanalytic.com>> wrote:
>
> Chris,
>
> I've used the Iconic Rewriter with older versions of IIS (the
> native rewriting capability in IIS7 looks interesting). You may
> be able to use an environment variable to set the default map
> file, but this may not be very useful if you have multiple map
> files. There are a few other options for hiding the mapfile
> (proxy script, redirect, form post instead of get, etc), put I
> think the rewrite method is the most effective (the client never
> gets the map file path), with almost no performance hit.
>
> The way I access Mapnik tiles in mapserver is to create a layer
> in the map file:
>
> LAYER
> DATA "frmt_wms_openstreetmap_MAPNIK.xml"
> NAME "Mapnik"
> PROJECTION
> "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"
> END
> STATUS ON
> TYPE RASTER
> PROCESSING "OVERSAMPLE_RATIO=1"
> PROCESSING "LOAD_FULL_RES_IMAGE=NO"
> UNITS METERS
> END # LAYER
>
> and frmt_wms_openstreetmap_MAPNIK.xml XML file of
>
> <GDAL_WMS>
> <Service name="TMS">
> <ServerUrl>http://tile.openstreetmap.org/${z}/${x}/${y}.png</ServerUrl>
> </Service>
> <DataWindow>
> <UpperLeftX>-20037508.34</UpperLeftX>
> <UpperLeftY>20037508.34</UpperLeftY>
> <LowerRightX>20037508.34</LowerRightX>
> <LowerRightY>-20037508.34</LowerRightY>
> <TileLevel>19</TileLevel>
> <TileCountX>1</TileCountX>
> <TileCountY>1</TileCountY>
> <YOrigin>top</YOrigin>
> </DataWindow>
> <Projection>EPSG:900913</Projection>
> <BlockSizeX>256</BlockSizeX>
> <BlockSizeY>256</BlockSizeY>
> <BandsCount>3</BandsCount>
> <Cache />
> </GDAL_WMS>
>
>
> Best Regards,
> Brent Fraser
>
>
> On 9/2/2011 8:13 AM, Chris Jackson wrote:
>> Hi
>>
>> I just wanted to check if the only way to parse a mapfile in an
>> IIS environment to use an absolute path to the mapfiles e.g.
>> http://myserver/cgi-bin/mapserv.exe?map=C:\Inetpub\wwwroot\workshop\itasca.map.
>> I wonder if anyone has had success with rewrite rules (IIS7)?
>>
>> Also how is GDAL triggered when calling the mapfile (in IIS).
>> The scenario is I am trying to use an xml in the mapfile layer
>> which then calls http://tile.openstreetmap.org/
>>
>> The XML is
>>
>> <GDAL_WMS>
>> <Service name="TMS">
>> <ServerUrl>http://tile.openstreetmap.org/${z}/${x}/${y}.png
>> <http://tile.openstreetmap.org/$%7Bz%7D/$%7Bx%7D/$%7By%7D.png></ServerUrl>
>> </Service>
>> <DataWindow>
>> <UpperLeftX>-20037508.34</UpperLeftX>
>> <UpperLeftY>20037508.34</UpperLeftY>
>> <LowerRightX>20037508.34</LowerRightX>
>> <LowerRightY>-20037508.34</LowerRightY>
>> <TileLevel>19</TileLevel>
>> <TileCountX>1</TileCountX>
>> <TileCountY>1</TileCountY>
>> <YOrigin>top</YOrigin>
>> </DataWindow>
>> <Projection>EPSG:900913</Projection>
>> <BlockSizeX>256</BlockSizeX>
>> <BlockSizeY>256</BlockSizeY>
>> <BandsCount>3</BandsCount>
>> <Cache/>
>> </GDAL_WMS>
>>
>> Am I remotely doing this the right way? I am used to calling
>> local data from the mapfile and tiled services is a bit of a new
>> beast, so I thought I would give it a go!
>>
>> Many thanks in advance
>>
>> Chris
>>
>>
>> _______________________________________________
>> mapserver-users mailing list
>> mapserver-users at lists.osgeo.org <mailto:mapserver-users at lists.osgeo.org>
>> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20110902/03970be0/attachment.htm>
More information about the MapServer-users
mailing list