[mapserver-dev] Adding a time index stamp to returned image.

Lime, Steve D (MNIT) Steve.Lime at state.mn.us
Fri Jul 24 14:08:02 PDT 2015


Should be very doable – I like a challenge. You’re not saying much about how you were going about it. I created a quick test that drops the current time in the center of the map where the time is from the now() function in PostgreSQL. See:

  http://maps1.dnr.state.mn.us/cgi-bin/mapserv64?mode=map&map=/usr/local/mapserver/apps/test/timestamp/test.map

If you refresh it you’ll get the timestamp associated. Presumably you could format this to your liking using the various utilities in PostgreSQL. To do this I had to create a dummy table in my database that contained a single dummy column, and I added 1 row to it. That allowed me to get useful SQL generated via MapServer. The timestamp layer looks like:

 LAYER
    NAME “timestamp”
    TYPE POINT
    STATUS DEFAULT

    TRANSFORM FALSE
    UNITS PERCENTAGES

    CONNECTIONTYPE POSTGIS
    CONNECTION “database of your choice”
    DATA "the_geom FROM (SELECT ST_MakePoint(.50, .50) AS the_geom, NOW() AS tstamp, dummy_column FROM dummy_table) AS foo USING UNIQUE dummy_column USING SRID=-1"
    LABELITEM tstamp
    CLASS
      LABEL
        TYPE TRUETYPE
        FONT “verdana-bold”
        COLOR 0 0 0
        SIZE 12
        POSITION CC
      END
    END
  END

To change the location of the point you’d edit the coordinates inside the ST_MakePoint() function. Hope it helps.

Steve

From: mapserver-dev-bounces at lists.osgeo.org [mailto:mapserver-dev-bounces at lists.osgeo.org] On Behalf Of Basques, Bob (CI-StPaul)
Sent: Tuesday, July 21, 2015 4:09 PM
To: mapserver-dev at lists.osgeo.org
Subject: [mapserver-dev] Adding a time index stamp to returned image.

All,

I’m using a POSTGRES connection an trying to place a timestamp text chunk into the corner of a image from Postgres.

I’ve got a method for generating a set of images for a time-lapse movie (https://www.dropbox.com/s/7spkctc2mmtfmhc/out4.mp4?dl=0), but need to add a timestamp to each of the images upon output.  I’m not having much luck though outputting a seemingly simple item from Postgres.  Fro some reason TimeStamps are not completely understood by MapServer.  Maybe I need to cast the timestamp to a text string or something . . .

Thoughts??

Thanks

bobb


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20150724/02f2dbbd/attachment.html>


More information about the mapserver-dev mailing list