[Tilecache] Newbie having trouble getting 'local' MapServer/WMS data to display via TC

Greg Cocks gcocks at stoller.com
Wed May 21 16:55:42 EDT 2008


Hello,

I am a newbie having trouble getting 'local' MapServer/WMS data to display via TC – and banging my head!   ☺

I have successfully linked to and start caching external data sources – e.g.,

 [drg]
type=WMSLayer
layers=DRG
url=http://terraservice.net/ogcmap.ashx?
extension=png
debug=off

------

var drg = new OpenLayers.Layer.WMS  (
                                      "USGS Topo (aka DRG)", 
                                      "/TileCache_202/tilecache.py?",
                                      {
                                        layers: 'drg',
                                        format: 'image/png'
                                      }
                                    );
map.addLayer(drg);

------
------

I have been able to able to link to my MapSever file via WMS - e.g.,

var centres_direct = new OpenLayers.Layer.WMS  (
                                                          "Site Centre/s",
                                                          "https://192.168.0.15/cgi-bin/mapserv.exe?map=c:/Inetpub/wwwroot/MapServer/WMS/strathmore_wms.map&service=WMS&",
                                                          {
                                                            layers:       'strathmore_site_centres',
                                                            transparent:  'true',
                                                            format:       'image/png'
                                                          },
                                                          {
                                                            gutter:       15
                                                          }
                                                        );
      map.addLayer(centres_direct);
      centres_direct.setVisibility(true);
      map.addLayer(centres_direct);
      centres_direct.setVisibility(true);

------
------

However, I have had *N0* luck with linking to my 'local' data via TC methods, either as a MapServerLayer or a WMSLayer- e.g..

[strathmore_site_centres]
type=MapServerLayer
layers=strathmore_site_centres
mapfile=C:\Inetpub\wwwroot\MapServer\WMS\strathmore_wms.map
extension=png
description=Site Centres
debug=on
bbox=-109.740997,-14.069800,-70.440598,55.966999
MaxResolution=1.40625

------

var centres = new OpenLayers.Layer.WMS (
                                         "Site Centre/s (TC)", 
                                         "/TileCache_202/tilecache.py?",
						     {
                                           layers:       'centres',
                                           format:       'image/png',
                                           transparent:  'true'
                                          },
                                          {
                                         	 reproject:    false
                                          }
                                         );
map.addLayer(centres);
centres.setVisibility(false);

------
------

As you can see I am using IIS... and if of any use I cut and paste my strathmore_wms.map file below, slightly munged...

And suggestions would be MUCH appreciated!   :-)   I try and learn things myself as much as possible, but this is doing my head in right now!  :-)

(Aside - next I need to work out (i) the Google Maps data offset, and (ii) whether I can connect to ArcIMS servers - that USDA NAIP imagery is too good to disregard!)

Thanks in advance!


----------
Regards,
GREG COCKS
GIS Analyst V
gcocks at stoller.com
S. M. Stoller Corp
105 Technology Drive, Suite 190
Broomfield, CO 80021
www.stoller.com
303-546-4300
303-443-1408 fax
303-546-4422 direct
303-828-7576 cell

--------------------------------------------------
--------------------------------------------------

#########################################################
#                                                       #
#                 MAPSERVER TO OPENLAYERS               #
#              'PROOF OF CONCEPT' TEST FILE             #
#          for the [munge]        #
#                                                       #
#           by Greg Cocks, of SM Stoller Corp.          #
#                 (gcocks at stoller.com)                  #
#                       May '08                         #
#                                                       #
#    -----------------------------------------------    #
#    | NOT THE FINAL PRODUCTION MAPSERVER WMS FILE |    #
#    -----------------------------------------------    #
#                                                       #
#########################################################



  NAME Strathmore_WMS




  #######################
  #  MAP CONFIGURATION  #
  #######################

  STATUS ON

  CONFIG PROJ_LIB "C:\Inetpub\wwwroot\MapServer\proj\nad"
  
  FONTSET "C:\Inetpub\wwwroot\MapServer\fontsets\MS_fontsets.txt"
  
  SHAPEPATH "C:\Inetpub\wwwroot\MapServer\data\"
  
  SIZE 500 500

  EXTENT -109.740997 -14.069800 -70.440598 55.966999 # GCS WGS84 (EPSG:4326) [munge]

  # EXTENT -180 -90 180 90

  UNITS DD # i.e., for GCS

  IMAGECOLOR 255 255 255
  
  IMAGETYPE AGG_PNG
  
  OUTPUTFORMAT
    NAME "AGG_PNG"
    DRIVER "AGG/PNG"
    IMAGEMODE RGB
  END

  

  WEB
    IMAGEPATH "C:\Inetpub\wwwroot\tmp\ms_tmp\"
    IMAGEURL "/tmp/ms_tmp/"
    METADATA
      "wms_title"               "WMS Server"
      "wms_onlineresource"      "cgi-bin/mapserv.exe?map=C:\Inetpub\wwwroot\MapServer\WMS\strathmore_wms.map"
      "wms_srs"                 "EPSG:4326 EPSG:4269 EPSG:26912 EPSG:26913 EPSG:2259 EPSG:900913"
    END # METADATA
  END # WEB

  PROJECTION
    "init=epsg:4326"
  END # PROJECTION


  #########################
  #  SYMBOL DEFINITION/S  #
  #########################

  SYMBOL
    NAME    "circle"
    TYPE    ellipse
    FILLED  true
    POINTS
      1 1
    END # POINTS
  END # SYMBOL
  
  SYMBOL
    NAME "square"
    TYPE vector
    FILLED true
    POINTS
      0 0
      0 1
      1 1
      1 0
      0 0
    END # POINTS
    STYLE
      8 12 8 12
    END # STYLE
  END # SYMBOL
  
  SYMBOL
    NAME "cross"
    TYPE vector
    FILLED true
    POINTS
      1 0
      1 1
      0 1
      2 1
      1 1
      1 2
    END # POINTS
  END # SYMBOL


  ########################
  #  LAYER DEFINITION/S  #
  ########################

  LAYER
    NAME "drg_mckinley"
    METADATA
      "wms_title"   "drg_mckinley"
      "wms_srs"     "EPSG:26912"
    END # METADATA
    DATA "DRG\drg_s_nm031.sid"
    TYPE raster
    STATUS off
    PROCESSING "DITHER=YES"
    PROJECTION
      "init=epsg:26912"
    END # PROJECTION
	END # LAYER
	
	LAYER
    NAME "naip_mckinley"
    METADATA
      "wms_title"   "naip_mckinley"
      "wms_srs"     "EPSG:26912"
    END # METADATA
    DATA "DOQ\ortho2-2_1n_s_nm031_2005.sid"
    TYPE raster
    STATUS off
    PROCESSING "DITHER=YES"
    PROJECTION
      "init=epsg:26912"
    END # PROJECTION
	END # LAYER
	
	LAYER
    NAME "pg_counties"
    TYPE polygon
    METADATA
      "wms_title"   "counties"
      "wms_srs"     "EPSG:4269"
    END # METADATA
    LABELCACHE on
    STATUS off
    MAXSCALE 10000000
    CONNECTIONTYPE postgis
    CONNECTION "dbname=gv_test user=MAPSERVER_access password=Maps4Ever2Day host=192.168.0.15 port=5432"
    DATA "the_geom FROM counties"
    LABELITEM "county"
    CLASS
      NAME "County Boundaries" #for Legend, etc
      SYMBOL "circle"
      SIZE 2
      OUTLINECOLOR 255 255 0
      #LABEL
        #COLOR 255 255 0
        #MINFEATURESIZE 200
        #TYPE TRUETYPE
        #FONT ARIAL
        #SIZE 10
      #END # LABEL
    END # CLASS
    PROJECTION
      "init=epsg:4269"
    END # PROJECTION
	END # LAYER
	
	LAYER
    NAME "pg_states"
    TYPE polygon
    METADATA
      "wms_title"   "pg_states"
      "wms_srs"     "EPSG:4269"
    END # METADATA
    LABELCACHE on
    STATUS off
    MINSCALE 2000000
    CONNECTIONTYPE postgis
    CONNECTION "dbname=gv_test user=MAPSERVER_access password=Maps4Ever2Day host=192.168.0.15 port=5432"
    DATA "the_geom FROM states"
    LABELITEM "state_name"
    CLASS
      NAME "pg_states" #legend
      SYMBOL "circle"
      SIZE 2
      OUTLINECOLOR 255 0 0
      #LABEL
        #COLOR 255 0 0
        #OUTLINECOLOR 255 255 255
        #MINFEATURESIZE 20
        #TYPE TRUETYPE
        #FONT ARIAL
        #SIZE 12
      #END # LABEL
    END # CLASS
    PROJECTION
      "init=epsg:4269"
    END # PROJECTION
	END # LAYER
	
	LAYER
    NAME "strathmore_site_centres"
    TYPE point
    METADATA
      "wms_title"   "strathmore_site_centres"
      "wms_srs"     "EPSG:4326"
    END # METADATA
    STATUS off
    CONNECTIONTYPE ogr
    CONNECTION "C:\Inetpub\wwwroot\MapServer\WMS\strathmore.ovf"
    DATA "strathmore_site_centres"
    LABELITEM "site_id"
    LABELCACHE on
    CLASS
      NAME "strathmore_site_centres" #legend, etc
      SYMBOL "square"
      SIZE 7
      COLOR 255 255 100
      OUTLINECOLOR 0 0 0
      LABEL
        COLOR 0 0 0
        OUTLINECOLOR 255 255 0
        TYPE TRUETYPE
        FONT ARIAL
        SIZE 9
        POSITION auto
      END # LABEL
    END # CLASS
    PROJECTION
      "init=epsg:4326"
    END # PROJECTION
	END # LAYER
	
	LAYER
    NAME "strathmore_site_boundaries"
    METADATA
      "wms_title"   "strathmore_site_boundaries"
      "wms_srs"     "EPSG:4269"
    END # METADATA
    TYPE POLYGON
    STATUS off
    # MAXSCALE 1000000
    DATA "strathmore_site_polygons"
    PROJECTION
      "init=epsg:4269"
    END # PROJECTION
    LABELITEM "site_id"
    LABELCACHE on
    LABELMAXSCALEDENOM 1000000
    CLASS
      NAME "strathmore_site_boundaries" #for Legend, etc
      STYLE
        OUTLINECOLOR 0 0 255
        WIDTH 2
      END # STYLE
      LABEL
        COLOR 0 0 0
        OUTLINECOLOR 0 0 255
        TYPE TRUETYPE
        FONT ARIAL
        SIZE 9
        POSITION auto
      END # LABEL  
    END # CLASS
  END # LAYER
  
  LAYER
    NAME "rh_strathmore_drilled_locations"
    TYPE point
    METADATA
      "wms_title"   "rh_strathmore_drilled_locations"
      "wms_srs"     "EPSG:2259"
    END # METADATA
    STATUS off
    MAXSCALE 500000
    CONNECTIONTYPE ogr
    CONNECTION "C:\Inetpub\wwwroot\MapServer\WMS\strathmore.ovf"
    DATA "rh_strathmore_drilled_locations"
    LABELITEM "id_alias"
    LABELCACHE on
    CLASS
      NAME "rh_strathmore_drilled_locations" #legend
      SYMBOL "circle"
      SIZE 10
      COLOR 0 0 255
      OUTLINECOLOR 0 0 0
      LABEL
        COLOR 0 0 0
        OUTLINECOLOR 0 0 255
        TYPE TRUETYPE
        FONT ARIAL
        SIZE 9
        POSITION auto
      END # LABEL
    END # CLASS
    PROJECTION
      "init=epsg:2259"
    END # PROJECTION
	END # LAYER
	
	LAYER
    NAME "rh_specific_offsite_wells"
    TYPE point
    METADATA
      "wms_title"   "rh_specific_offsite_wells"
      "wms_srs"     "EPSG:2259"
    END # METADATA
    STATUS off
    MAXSCALE 500000
    CONNECTIONTYPE ogr
    CONNECTION "C:\Inetpub\wwwroot\MapServer\WMS\strathmore.ovf"
    DATA "rh_specific_offsite_wells"
    LABELITEM "permit_id"
    LABELCACHE on
    CLASS
      NAME "rh_specific_offsite_wells" #legend
      SYMBOL "circle"
      SIZE 10
      COLOR 255 0 0
      OUTLINECOLOR 0 0 0
      LABEL
        COLOR 0 0 0
        OUTLINECOLOR 255 0 0
        TYPE TRUETYPE
        FONT ARIAL
        SIZE 9
        POSITION auto
      END # LABEL
    END # CLASS
    PROJECTION
      "init=epsg:2259"
    END # PROJECTION
	END # LAYER
  
  LAYER
    NAME "rh_fernandez_wri_locations"
    TYPE point
    METADATA
      "wms_title"   "rh_fernandez_wri_locations"
      "wms_srs"     "EPSG:2259"
    END # METADATA
    STATUS off
    MAXSCALE 500000
    CONNECTIONTYPE ogr
    CONNECTION "C:\Inetpub\wwwroot\MapServer\WMS\strathmore.ovf"
    DATA "rh_fernandez_wri_locations"
    LABELITEM "wri_id"
    LABELCACHE on
    CLASS
      NAME "rh_fernandez_wri_locations" #legend
      SYMBOL "square"
      SIZE 10
      COLOR 0 255 0
      OUTLINECOLOR 0 0 0
      LABEL
        COLOR 0 0 0
        OUTLINECOLOR 0 255 0
        TYPE TRUETYPE
        FONT ARIAL
        SIZE 10
        POSITION auto
      END # LABEL
    END # CLASS
    PROJECTION
      "init=epsg:2259"
    END # PROJECTION
	END # LAYER
	
END # MAP


More information about the Tilecache mailing list