Timestamped Map

Brent Fraser bfraser at GEOANALYTIC.COM
Mon Oct 25 12:30:59 EDT 2004


Charlie,

  While the [imagedate] "variable" looks like MapServer CGI variable, it's
not.  It's just something I invented (well, borrowed) for a particular
implementation.  The Mapserver CGI variable you will be using for the map
file snippet below is map_TimeStamp_feature_text.  You set it in the URL the
client passes to the server.  It won't work to set  [imagedate] in the URL
as Mapserver has no clue about that variable, and has no way to set text in
the mapfile.  It DOES have a way to substitute the entire contents of a map
file object using the map_ syntax. See the bottom of
http://mapserver.gis.umn.edu/doc42/cgi-reference.html ("Changing map file
parameters...")

  What does your URL look like?

Brent

----- Original Message -----
From: "IMD Listuser" <imd_listuser at COMCAST.NET>
To: <MAPSERVER-USERS at LISTS.UMN.EDU>
Sent: Monday, October 25, 2004 9:44 AM
Subject: Re: [UMN_MAPSERVER-USERS] Timestamped Map


Hi

Thanks for the reply.

Unfortunately when I try to duplicate your code, the only thing that
appears on the map is "Terra MODIS [imagedate] [imagetime] UT". Even if
I substitute a known cgi variable like [mapext], it does not get
evaluated prior to being drawn on the map.

Hmmm. Any Ideas

Charlie

-----Original Message-----
From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On
Behalf Of Brent Fraser
Sent: Monday, October 25, 2004 10:46
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: Re: [UMN_MAPSERVER-USERS] Timestamped Map

Charlie,

 I'm not sure if this is the best way but we did something similar a
couple of years ago using the following layer definition:

LAYER
  NAME "TimeStamp"
  TYPE ANNOTATION
  STATUS DEFAULT
  TRANSFORM FALSE
  FEATURE
    POINTS 20 20 END # Text in Upper-left
    TEXT "Terra MODIS [imagedate] [imagetime] UT"
  END
  CLASS
        LABEL
          COLOR 255 255 255
          OUTLINECOLOR 0 0 0
          TYPE TRUETYPE
          FONT comic
          SIZE 16
          POSITION AUTO
          FORCE TRUE
          OFFSET 10 10
          PARTIALS FALSE
          WRAP ","
        END # Label
     END  # CLASS
END


In our case we pre-processed the map file to substitute the "[imagedate]
[imagetime]" with the date the data was aquired (not the date the map
graphic was generated) by using some purpose-built software on the
server.

I think you would be able to use a CGI variable to change the text, but
I haven't tried it.  I think the CGI syntax would be something like:

...&map_TimeStamp_feature_text=Terra+Modis+20041025&...

and you'll likely need URL encoding for characters other than
alphanumerics.

Brent Fraser
GeoAnalytic Inc.



----- Original Message -----
From: "IMD Listuser" <imd_listuser at COMCAST.NET>
To: <MAPSERVER-USERS at LISTS.UMN.EDU>
Sent: Monday, October 25, 2004 7:38 AM
Subject: [UMN_MAPSERVER-USERS] Timestamped Map


Greetings,

Id like to place a timestamp on each map that is created.

What is the bext way to do this? Im using mapserver cgi version 4.2 and
Id prefer to not change this configuration. If possible Id like to do so
using the map file or dhtml.

TIA

Charlie



More information about the mapserver-users mailing list