[mapserver-users] TIme support on mapserver 5.6.3, it's working?

rai 8 max1000 at gmail.com
Mon Jul 5 10:48:36 EDT 2010


I try to fix time_extends with layer and the behaivor are the same, also I
logged the postgresql & mapserver:

with this query show always the first image , at the 11:00:00, in the log of
postgresql the query has not time parameter

http://mapserver-tutorial/cgi-bin/mapserv?map=/home/vbox/Downloads/mapserver-tutorial/ms4w/apps/tutorial/htdocs/tile_time.map&LAYERS=sat_w,time_w&mode=map&TIME=2007-05-11T11:00:00

postgresql
2010-07-05 16:14:26 CEST LOG:  statement: select attname from pg_attribute,
pg_constraint, pg_class where pg_constraint.conrelid = pg_class.oid and
pg_class.oid = pg_attribute.attrelid and pg_constraint.contype = 'p' and
pg_constraint.conkey[1] = pg_attribute.attnum and pg_class.relname =
'tile_index' and pg_table_is_visible(pg_class.oid) and
pg_constraint.conkey[2] is null
2010-07-05 16:14:26 CEST LOG:  statement: select
encode(AsBinary(force_collection(force_2d("tile_geom")),'NDR'),'base64') as
geom,"oid" from tile_index where tile_geom &&
GeomFromText('POLYGON((165660.980559345 -371954.772084,165660.980559345
632767.19157,1506410.35680666 632767.19157,1506410.35680666
-371954.772084,165660.980559345
-371954.772084))',find_srid('','tile_index','tile_geom'))
2010-07-05 16:14:27 CEST LOG:  statement: select attname from pg_attribute,
pg_constraint, pg_class where pg_constraint.conrelid = pg_class.oid and
pg_class.oid = pg_attribute.attrelid and pg_constraint.contype = 'p' and
pg_constraint.conkey[1] = pg_attribute.attnum and pg_class.relname =
'tile_index' and pg_table_is_visible(pg_class.oid) and
pg_constraint.conkey[2] is null
2010-07-05 16:14:27 CEST LOG:  statement: select
"tile_filepath",encode(AsBinary(force_collection(force_2d("tile_geom")),'NDR'),'base64')
as geom,"oid" from tile_index where tile_geom &&
GeomFromText('POLYGON((-98.0072083861835 40.1776647603121,-98.0072083861835
50.6708031292285,-79.1036733841116 50.6708031292285,-79.1036733841116
40.1776647603121,-98.0072083861835
40.1776647603121))',find_srid('','tile_index','tile_geom'))



with this url selects first image but show the second, in this case the
query take into account time parameter

http://mapserver-tutorial/cgi-bin/mapserv?map=/home/vbox/Downloads/mapserver-tutorial/ms4w/apps/tutorial/htdocs/tile_time.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&LAYERS=time_w,sat_w&WIDTH=800&HEIGHT=400&FORMAT=image/png&TRANSPARENT=false&srs=EPSG:4326&BBOX=-126,24,-66,50&TIME=2007-05-11T10:00:00

postgresql
2010-07-05 16:05:29 CEST LOG:  statement: select attname from pg_attribute,
pg_constraint, pg_class where pg_constraint.conrelid = pg_class.oid and
pg_class.oid = pg_attribute.attrelid and pg_constraint.contype = 'p' and
pg_constraint.conkey[1] = pg_attribute.attnum and pg_class.relname =
'tile_index' and pg_table_is_visible(pg_class.oid) and
pg_constraint.conkey[2] is null
2010-07-05 16:05:30 CEST LOG:  statement: select
"tile_timestamp","tile_filepath",encode(AsBinary(force_collection(force_2d("tile_geom")),'NDR'),'base64')
as geom,"oid" from tile_index where tile_geom && GeomFromText('POLYGON((-126
24,-126 50,-66 50,-66 24,-126 24))',find_srid('','tile_index','tile_geom'))
and (date_trunc('second', tile_timestamp) = '2004-01-01T10:10:00Z') and
(date_trunc('second', tile_timestamp) = '2004-01-01T10:10:00Z')
2010-07-05 16:05:30 CEST LOG:  statement: select
"image_time",encode(AsBinary(force_collection(force_2d("the_geom")),'NDR'),'base64')
as geom,"oid" from satellite where the_geom &&
GeomFromText('POLYGON((-2639868.99029283 -2322020.83542886,-2639868.99029283
1072412.78850334,3408818.1364184 1072412.78850334,3408818.1364184
-2322020.83542886,-2639868.99029283
-2322020.83542886))',find_srid('','satellite','the_geom')) and
(date_trunc('second', image_time) = '2007-05-11T10:00:00')
2010-07-05 16:05:30 CEST LOG:  statement: select
"image_time","image_path",encode(AsBinary(force_collection(force_2d("the_geom")),'NDR'),'base64')
as geom,"oid" from satellite where the_geom && GeomFromText('POLYGON((-126
24,-126 50,-66 50,-66 24,-126 24))',find_srid('','satellite','the_geom'))
and (date_trunc('second', image_time) = '2007-05-11T10:00:00')

mapserver
[Mon Jul  5 16:44:46 2010].254344 msPostGISLayerWhichShapes query: select
"image_time",encode(AsBinary(force_colle
ction(force_2d("the_geom")),'NDR'),'base64') as geom,"oid" from satellite
where the_geom && GeomFromText('POLYGON(
(-2639868.99029283 -2322020.83542886,-2639868.99029283
1072412.78850334,3408818.1364184 1072412.78850334,3408818.1
364184 -2322020.83542886,-2639868.99029283
-2322020.83542886))',find_srid('','satellite','the_geom')) and (date_tr
unc('second', image_time) = '2007-05-11T11:00:00')
[Mon Jul  5 16:44:46 2010].352763 msPostGISLayerWhichShapes query status: 2
[Mon Jul  5 16:44:46 2010].352796 msPostGISLayerWhichShapes got 1 records in
result.
[Mon Jul  5 16:44:46 2010].352817 msPostGISLayerNextShape called.
[Mon Jul  5 16:44:46 2010].352835 msPostGISReadShape called.
[Mon Jul  5 16:44:46 2010].352858 msPostGISReadShape: [image_time]
"2007-05-11 11:00:00"


the same above but with "&mode=map" will have the same behavior than the
first url, show always the first image

when you put seconds in the url postgresql recives a query with
date_trunc('second', image_time) , If put only minute date_trunc('minute',
image_time), it seems that mapserver detect what kind of time parameter is.


It's so tricky this mapserver :/ , thanks daryl & alexander


2010/7/3 Alexander Petkov <greenkov at gmail.com>

> I suggest that you carefully inspect your definitions in your mapfile,
> as well as the data in the Postgis DB itself.
> Turn debugging on, and inspect the log file closely.
> Also, if you already haven't, enable PostgreSQL logging, inspect
> incoming requests to your database as well.
>
> For example, one inconsistency that is evident from your map file is
> the date format--the "wms_timeextent" item for the "sat_w" layer
> contains a date range, while your Postgis data also has a timestamp
> data type with HH24:MI data. I would eliminate those inconsistensies
> first.
>
> List each time step individually (comma separated) in your mapfile ,
> since your number of records for the time being is small, rather than
> specifying a date range.
>
> Again, do not be shy about inspecting the log files. Randomly trying
> "a lot of combinations", as well as different Mapserver versions
> hoping that something will work will likely not help.
>
> Alex
>
> On Fri, Jul 2, 2010 at 6:20 AM, rai 8 <max1000 at gmail.com> wrote:
> >> Could you provide an example URL you are using to test out the WMS-T?  I
> >> am using WMS-T on 5.6.3 without any known issues.  Please note that if
> your
> >> time table gets very large, you may hit this quirk:
> >
> > I am using URL like:
> >
> http://mapserver-tutorial/cgi-bin/mapserv?map=/home/vbox/map_directory/tile_time_2.map&layer=radar&layer=time_idx_pg&mode=map&TIME=2004-01-01T10:10:00
> >
> > It shows an image but always the first ->
> > /home/vbox/Downloads/animacio/sat1.tif , that have the timestamp:
> 2007-05-11
> > 10:00Z
> >
> > My table its very little, I was wrong about the version, is the 5.4.2,
> i'll
> > try to do the same with the 5.6 but it's very strange that any
> configuration
> > that I tried doesn't work.
> >
> >> need to be in the METADATA section of the "sat_w" layer.
> >
> > I tried a lot of combinations, also with all the metadata in sat_w like
> > "official" tutorial
> >
> >
> > thanks a lot!
> >
> >
> >
> >
> > 2010/7/1 Alexander Petkov <greenkov at gmail.com>
> >>
> >> On Thu, Jul 1, 2010 at 6:27 AM, rai 8 <max1000 at gmail.com> wrote:
> >> > Hello,
> >> >
> >> > I've been working with mapserver to get a map with time support, time
> >>  > parameter, I followed the tutorial in documetation
> >> > http://mapserver.org/ogc/wms_time.html and this post
> >> >
> >> >
> http://osgeo-org.1803224.n2.nabble.com/Accessing-images-using-time-dimension-td1991324.html#a1991324
> >> > and I can't run the mapserver to change the image with a time
> parameter.
> >> >
> >> > I test several configurations but any works, the last is the same like
> >> > the
> >> > post in the maillist, this is what i've done:
> >> >
> >> > in a postgis database
> >> >
> >> > create table satellite (image_path text, image_time timestamp);
> >> > select AddGeometryColumn('satellite', 'the_geom', 4326, 'POLYGON', 2);
> >> >
> >> > insert into satellite (image_path, image_time, the_geom)
> >> > values ('/home/vbox/Downloads/animacio/sat1.tif', '2007-05-11 10:00Z',
> >> > GeomFromText('POLYGON((-31.82 75.55, -31.82 26.5, 51.31 26.5,51.31
> >> > 75.55,
> >> > -31.82 75.55))', 4326));
> >> >
> >> > insert into satellite (image_path, image_time, the_geom)
> >> > values ('/home/vbox/Downloads/animacio/sat2.tif', '2007-05-11 11:00Z',
> >> > GeomFromText('POLYGON((-31.82 75.55, -31.82 26.5, 51.31 26.5,51.31
> >> > 75.55,
> >> > -31.82 75.55))', 4326));
> >> >
> >> >
> >> > and the map file:
> >> >
> >> >  LAYER
> >> >     NAME    "time_w"
> >> >     TYPE    POLYGON
> >> >     STATUS    ON
> >> >     CONNECTIONTYPE  POSTGIS
> >> >     CONNECTION    "dbname=tile_index host=127.0.0.1 user=postgres
> >> > password=xxxxxx"
> >> >     DATA    "the_geom from satellite using unique oid using srid =
> 4326"
> >> >     METADATA
> >> >         "wms_title"    "time_index_w"
> >> >         "wms_srs"    "EPSG:4326"
> >> >         "wms_timeextent"    "2007-01-01/2007-12-31"
> >> >         "wms_timedefault"   "2007-05-11T11:00:00Z"
> >> >         "wms_timeitem"    "image_time" #a column in postgis table of
> >> > type
> >> >     END
> >> >   END
> >> >
> >> >   LAYER
> >> >     NAME    "sat_w"
> >> >     STATUS  ON
> >> >     TYPE    RASTER
> >> >     METADATA
> >> >         "wms_title"    "Satellite"
> >> >         "wms_timeextent"    "2007-01-01/2007-12-31"
> >> >     END
> >> >     PROJECTION
> >> >       "init=epsg:4326"
> >> >     END
> >> >     TILEINDEX "time_w" # Layer name containing time index
> >> >     TILEITEM  "image_path" # DB column containing path to image
> >> >   END
> >> >
> >> >
> >> > anyone finds some error?
> >> >
> >> >
> >> > thanks
> >>
> >> The time-related metadata items:
> >>
> >> "wms_timeextent"    "2007-01-01/2007-12-31"
> >>        "wms_timedefault"   "2007-05-11T11:00:00Z"
> >>        "wms_timeitem"    "image_time" #a column in postgis table of type
> >>
> >>
> >> need to be in the METADATA section of the "sat_w" layer.
> >>
> >> Alex
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20100705/19194cd0/attachment-0001.html


More information about the mapserver-users mailing list