Skip to topic | Skip to bottom
Home
Main
Main.CcSitesHowTor1.1 - 23 Mar 2005 - 21:27 - CharltonPurvistopic end

Start of topic | Skip to actions

Table of contents

The .map control file to produce the images

MAP
  NAME "SEA-COOS Near-Real Time Observations"
  STATUS ON
  EXTENT -81.6 31.7 -75.8 37.2
  SIZE 580 550
  SHAPEPATH "/usr2/maps/seacoos/data"
  SYMBOLSET "/usr2/maps/ref/symbols.sym"
  FONTSET "/usr2/maps/ref/fonts.txt"
  IMAGECOLOR 230 247 254 # seacoos_key.png
  UNITS DD
  IMAGETYPE PNG
  OUTPUTFORMAT
    NAME PNG
    DRIVER "GD/PNG"
    MIMETYPE "image/png"
    IMAGEMODE RGB
    EXTENSION "png"
  END
  PROJECTION
    "proj=latlong"
  END
  WEB
    IMAGEPATH "/tmp/ms_tmp/"
    IMAGEURL "/ms_tmp/"
  END
  LAYER
    NAME "Grid_lines"
    GROUP "Grid_lines"
    PROJECTION 
      "proj=latlong"
      "ellps=WGS84"
      "datum=WGS84"
    END
    TYPE LINE
    STATUS DEFAULT
    CLASS
      COLOR 202 229 240
      LABEL
        POSITION CC
        BUFFER 50
        FORCE FALSE
        TYPE BITMAP
        SIZE SMALL
        COLOR 147 167 175
      END
    END
    GRID
      MINARCS 5
      MAXARCS 5
    END
  END
  LAYER
    NAME "world_filled_bottom"
    STATUS DEFAULT
    DATA "the_geom from world_political_bounds"
    FILTER "name not like 'United States'"
    TYPE POLYGON
    CONNECTIONTYPE POSTGIS
    CONNECTION "xxx"
    METADATA
      layer_name "Land masses"
    END
    CLASS
      COLOR 250 249 227
    END
  END
  LAYER
    NAME "us_filled_bottom"
    STATUS DEFAULT
    DATA "the_geom from us_states_no_lakes"
    TYPE POLYGON
    CONNECTIONTYPE POSTGIS
    CONNECTION "xxx"
    PROJECTION
      "proj=latlong"
    END
    METADATA
      layer_name "Land masses"
    END
    CLASS
      COLOR 250 249 227
    END
  END
  LAYER
    NAME "world_outline"
    STATUS DEFAULT
    DATA "the_geom from world_political_bounds"
    FILTER "name not like 'United States'"
    TYPE POLYGON
    CONNECTIONTYPE POSTGIS
    CONNECTION "xxx"
    METADATA
      layer_name "Land outlines"
    END
    CLASS
      OUTLINECOLOR 210 210 210
    END
  END
  LAYER
    NAME "us_outline"
    STATUS DEFAULT
    DATA "the_geom from us_states_no_lakes"
    TYPE POLYGON
    CONNECTIONTYPE POSTGIS
    CONNECTION "xxx"
    PROJECTION
      "proj=latlong"
    END
    METADATA
      layer_name "Land outlines"
    END
    CLASS
      OUTLINECOLOR 210 210 210
    END
  END
  LAYER
    NAME "country_names"
    STATUS OFF
    DATA "the_geom from world_country_names"
    FILTER "name <> 'United States'" # already showing states
    TYPE POLYGON
    CONNECTIONTYPE POSTGIS
    CONNECTION "xxx"
    LABELITEM 'name'
    METADATA
      layer_name "Country & city names"
    END
    CLASS
      LABEL
        TYPE TRUETYPE
        FONT "arial"
        PARTIALS TRUE
        POSITION AUTO
        ANTIALIAS TRUE
        FORCE FALSE
        COLOR 130 130 130
        SIZE 7
      END
      STYLE END
    END
  END
  LAYER
    NAME "world_capitals"
    STATUS OFF
    DATA "the_geom from world_capitals"
    TYPE POINT
    CONNECTIONTYPE POSTGIS
    CONNECTION "xxx"
    PROJECTION
      "proj=latlong"
    END
    MAXSCALE 24646850 # will not draw at this scale
    LABELITEM 'name'
    METADATA
      layer_name "Country & city names"
    END
    CLASS
      LABEL
        TYPE TRUETYPE
        FONT "arial"
        PARTIALS TRUE
        POSITION AUTO
        ANTIALIAS TRUE
        FORCE TRUE
        COLOR 130 130 130
        SIZE 7
      END
      SYMBOL 'star'
      COLOR 130 130 130
      SIZE 5
    END
  END
  LAYER
    NAME "us_big_cities"
    STATUS OFF
    DATA "the_geom from purvis_us_cities"
    FILTER "feature like '%State Capital%' or (feature like '%499,999%' or feature like '%500,000%') and name <> 'Washington D.C.'"
    TYPE POINT
    CONNECTIONTYPE POSTGIS
    CONNECTION "xxx"
    PROJECTION
      "proj=latlong"
    END
    MAXSCALE 12323500 # will not draw at this scale
    LABELITEM 'name'
    METADATA
      layer_name "Country & city names"
    END
    CLASS
      LABEL
        TYPE TRUETYPE
        FONT "arial"
        PARTIALS TRUE
        POSITION AUTO
        ANTIALIAS TRUE
        FORCE TRUE
        COLOR 130 130 130
        SIZE 7
      END
      SYMBOL 'circle'
      COLOR 130 130 130
      SIZE 3
    END
  END
  LAYER
    NAME "sst_sites"
    STATUS OFF
    DATA "the_geom from (select distinct substring(station_id from 0 for position('_' in station_id)) as station_id, the_geom, 1 as seq from sst_map where the_geom && GeometryFromText('BOX3D(-81.3 32, -76.14 36.96)'::box3d,-1)) AS foo USING UNIQUE seq USING SRID=-1"
    TYPE POINT
    CONNECTIONTYPE POSTGIS
    CONNECTION "xxx"
    LABELITEM 'station_id'
    CLASS
      LABEL
        TYPE TRUETYPE
        FONT "arial"
        PARTIALS FALSE
        POSITION AUTO
        ANTIALIAS TRUE
        FORCE TRUE
        COLOR 0 0 0
        SIZE 7
      END
      SYMBOL 'circle'
      COLOR 255 0 0
      SIZE 7
    END
  END
  LAYER
    NAME "wind_sites"
    STATUS OFF
    DATA "the_geom from (select distinct substring(station_id from 0 for position('_' in station_id)) as station_id, the_geom, 1 as seq from wind_map where the_geom && GeometryFromText('BOX3D(-81.3 32, -76.14 36.96)'::box3d,-1)) AS foo USING UNIQUE seq USING SRID=-1"
    TYPE POINT
    CONNECTIONTYPE POSTGIS
    CONNECTION "xxx"
    LABELITEM 'station_id'
    CLASS
      LABEL
        TYPE TRUETYPE
        FONT "arial"
        PARTIALS FALSE
        POSITION AUTO
        ANTIALIAS TRUE
        FORCE TRUE
        COLOR 0 0 0
        SIZE 7
      END
      SYMBOL 'square'
      COLOR 0 146 0
      SIZE 4
    END
  END
  LAYER
    NAME "water_level_sites"
    STATUS OFF
    DATA "the_geom from (select distinct substring(station_id from 0 for position('_' in station_id)) as station_id, the_geom, 1 as seq from water_level_map where the_geom && GeometryFromText('BOX3D(-81.3 32, -76.14 36.96)'::box3d,-1)) AS foo USING UNIQUE seq USING SRID=-1"
    TYPE POINT
    CONNECTIONTYPE POSTGIS
    CONNECTION "xxx"
    LABELITEM 'station_id'
    CLASS
      LABEL
        TYPE TRUETYPE
        FONT "arial"
        PARTIALS FALSE
        POSITION AUTO
        ANTIALIAS TRUE
        FORCE TRUE
        COLOR 0 0 0
        SIZE 7
      END
      SYMBOL 'triangle'
      COLOR 0 0 255
      SIZE 7
    END
  END
  LAYER
    NAME "all_sites"
    STATUS OFF
    DATA "the_geom from (select distinct substring(station_id from 0 for position('_' in station_id)) as station_id, the_geom, 1 as seq from water_level_map where the_geom && GeometryFromText('BOX3D(-81.3 32, -76.14 36.96)'::box3d,-1) union select distinct substring(station_id from 0 for position('_' in station_id)) as station_id, the_geom, 1 as seq from sst_map where the_geom && GeometryFromText('BOX3D(-81.3 32, -76.14 36.96)'::box3d,-1) union select distinct substring(station_id from 0 for position('_' in station_id)) as station_id, the_geom, 1 as seq from wind_map where the_geom && GeometryFromText('BOX3D(-81.3 32, -76.14 36.96)'::box3d,-1)) AS foo USING UNIQUE seq USING SRID=-1"
    TYPE POINT
    CONNECTIONTYPE POSTGIS
    CONNECTION "xxx"
    LABELITEM 'station_id'
    CLASS
      LABEL
        TYPE TRUETYPE
        FONT "arial"
        PARTIALS FALSE
        POSITION AUTO
        ANTIALIAS TRUE
        FORCE TRUE
        COLOR 0 0 0
        SIZE 7
      END
      SYMBOL 'star'
      COLOR 0 0 255
      SIZE 7
    END
  END
END

SQL to pull out the data for the tables

psql xxx "select distinct 'water_level' as descrip, substring(station_id from 0 for position('_' in station_id)) as station_id_sub, station_id, institution, title, lon, lat from water_level_map where the_geom && GeometryFromText('BOX3D(-81.3 32, -76.14 36.96)'::box3d,-1) order by station_id, institution, title;" > water_level_sites.txt

psql xxx "select distinct 'sst' as descrip, substring(station_id from 0 for position('_' in station_id)) as station_id_sub, station_id, institution, title, lon, lat from sst_map where the_geom && GeometryFromText('BOX3D(-81.3 32, -76.14 36.96)'::box3d,-1) order by station_id, institution, title;" > sst_sites.txt

psql xxx "select distinct 'wind' as descrip, substring(station_id from 0 for position('_' in station_id)) as station_id_sub, station_id, institution, title, lon, lat from wind_map where the_geom && GeometryFromText('BOX3D(-81.3 32, -76.14 36.96)'::box3d,-1) order by station_id, institution, title;" > wind_sites.txt

psql xxx "select distinct 'water_level' as descrip, substring(station_id from 0 for position('_' in station_id)) as station_id_sub, station_id, institution, title, lon, lat from water_level_map where the_geom && GeometryFromText('BOX3D(-81.3 32, -76.14 36.96)'::box3d,-1) union select distinct 'sst' as descrip, substring(station_id from 0 for position('_' in station_id)) as station_id_sub, station_id, institution, title, lon, lat from sst_map where the_geom && GeometryFromText('BOX3D(-81.3 32, -76.14 36.96)'::box3d,-1) union select distinct 'wind' as descrip, substring(station_id from 0 for position('_' in station_id)) as station_id_sub, station_id, institution, title, lon, lat from wind_map where the_geom && GeometryFromText('BOX3D(-81.3 32, -76.14 36.96)'::box3d,-1) order by station_id, institution, title, lon, lat, station_id_sub;" > all_sites.txt

-- CharltonPurvis - 23 Mar 2005
to top


You are here: Main > CcSitesHowTo

to top

Copyright © 1999-2008 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Carocoops? Send feedback