Opened 16 years ago

Closed 16 years ago

#2388 closed defect (fixed)

time request is not applied when used with a result (<filter>)

Reported by: assefa Owned by: assefa
Priority: normal Milestone: 5.2 release
Component: SOS Server Version: unspecified
Severity: normal Keywords:
Cc: warmerdam, tomkralidis

Description

Initially reported by Jørn Vegard Røsnes <jorn@…>

I'm running Mapserver v5.1-dev. Postgresql is running with debug level 5.

When I send a request containing result and time filtering, it seems that only the result filtering is included in the generated SQL WHERE statement (from Postgresql log). The eventtime filtering seems to be omitted. URL (partly): eventtime=<gml:TimePeriod><gml:beginPosition>2007-11-05T08:00:00Z</gml:beginPosition><gml:endPosition>2007-11-05T08:30:00Z</gml:endPosition></gml:TimePeriod>& result=<Filter><ogc:PropertyIsEqualTo><ogc:PropertyName>mmsi_nb</ogc:PropertyName><ogc:Literal>258069000</ogc:Literal></ogc:PropertyIsEqualTo></Filter>

If I include only the eventtime in the SOS request, the SQL WHERE statement contains the time filtering. URL (partly): eventtime=<gml:TimePeriod><gml:beginPosition>2007-11-05T08:00:00Z</gml:beginPosition><gml:endPosition>2007-11-05T08:30:00Z</gml:endPosition></gml:TimePeriod>

Change History (8)

comment:1 by assefa, 16 years ago

Status: newassigned

This happens because the time filter is cleared when the result filter is applied.

Fix committed in r7008. Will fix after Jørn comments.

comment:2 by jorn, 16 years ago

Cc: warmerdam added

Hi,

I'm not able to compile Mapserver.

Frank Warmerdam: Any chance you could compile a Linux binary for me (FWTools?), please ?

Compilation error:

g++ -v -O2 -fPIC -Wall -DHAVE_VSNPRINTF -DNEED_STRLCAT -DUSE_PROJ -DUSE_SOS_SVR -DUSE_GD_GIF -DUSE_GD_PNG -DUSE_GD_JPEG -DUSE_GD_WBMP -DUSE_GD_FT -DGD_HAS_FTEX_XSHOW -DGD_HAS_GDIMAGEGIFPTR -DGD_HAS_GETBITMAPFONTS -DUSE_OGR -DUSE_ICONV -DUSE_ZLIB -I/usr/local/include -I/home/konserv/FWTools-1.4.2include -I/include -I/usr/local/include/libxml2 shp2img.o -L. -lmapserver -lgd -L/usr/local/lib -lgd -ljpeg -lfreetype -lpng -lz -ljpeg -lfreetype -lpng -lz -L/home/konserv/FWTools-1.4.2lib -lproj -ljpeg -L/lib -lgdal -L/usr3/pkg4/OpenEV_FW_Tree/FWTools/lib -lgeos -lgeos_c -L/usr3/pkg4/OpenEV_FW_Tree/FWTools/lib -lexpat -L/usr3/pkg4/OpenEV_FW_Tree/xerces-c-src_2_6_0/lib -lxerces-c -lpthread -L/usr3/pkg4/OpenEV_FW_Tree/Geo_DSDK-6.0.7.1407/lib/Release -L/usr3/pkg4/OpenEV_FW_Tree/Geo_DSDK-6.0.7.1407/3rd-party/lib/Release -lltidsdk -lpthread -L/usr3/pkg4/OpenEV_FW_Tree/FWTools/lib -lNCSEcw -lNCSCnet -lNCSUtil -L/usr3/pkg4/OpenEV_FW_Tree/HDF42_inst/lib -lmfhdf -ldf -logdi31 -ljpeg -L/usr3/pkg4/OpenEV_FW_Tree/FWTools/lib -lgeotiff -L/usr3/pkg4/OpenEV_FW_Tree/FWTools/lib -ltiff -lpng -lnetcdf -lcfitsio -lgrass5 -lpq -L/usr3/local/pgsql/lib -lpq -lz -lpthread -lm -lrt -ldl -L/usr3/pkg4/OpenEV_FW_Tree/kakadu-5.1/lib -lkdu -L/usr3/pkg4/OpenEV_FW_Tree/FWTools/lib -ldap -L/usr/local/lib -lcurl -ldl -lz -L/usr/local/lib -lxml2 -lz -lpthread -lm -lpthread -L/usr3/pkg4/OpenEV_FW_Tree/FWTools/lib -lsqlite3 -L/usr/local/lib -lcurl -ldl -lz -L/usr/local/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm -lc -lz -L/usr/local/lib -lxml2 -lz -lm -lm -lstdc++ -o shp2img

Reading specs from /usr/lib/gcc-lib/i586-suse-linux/3.3.4/specs Configured with: ../configure --enable-threads=posix --prefix=/usr --with-local-prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man --enable-languages=c,c++,f77,objc,java,ada --disable-checking --libdir=/usr/lib --enable-libgcj --with-gxx-include-dir=/usr/include/g++ --with-slibdir=/lib --with-system-zlib --enable-shared --enable-cxa_atexit i586-suse-linux Thread model: posix gcc version 3.3.4 (pre 3.3.5 20040809) /usr/lib/gcc-lib/i586-suse-linux/3.3.4/collect2 --eh-frame-hdr -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o shp2img /usr/lib/gcc-lib/i586-suse-linux/3.3.4/../../../crt1.o /usr/lib/gcc-lib/i586-suse-linux/3.3.4/../../../crti.o /usr/lib/gcc-lib/i586-suse-linux/3.3.4/crtbegin.o -L. -L/usr/local/lib -L/home/konserv/FWTools-1.4.2lib -L/lib -L/usr3/pkg4/OpenEV_FW_Tree/FWTools/lib -L/usr3/pkg4/OpenEV_FW_Tree/FWTools/lib -L/usr3/pkg4/OpenEV_FW_Tree/xerces-c-src_2_6_0/lib -L/usr3/pkg4/OpenEV_FW_Tree/Geo_DSDK-6.0.7.1407/lib/Release -L/usr3/pkg4/OpenEV_FW_Tree/Geo_DSDK-6.0.7.1407/3rd-party/lib/Release -L/usr3/pkg4/OpenEV_FW_Tree/FWTools/lib -L/usr3/pkg4/OpenEV_FW_Tree/HDF42_inst/lib -L/usr3/pkg4/OpenEV_FW_Tree/FWTools/lib -L/usr3/pkg4/OpenEV_FW_Tree/FWTools/lib -L/usr3/local/pgsql/lib -L/usr3/pkg4/OpenEV_FW_Tree/kakadu-5.1/lib -L/usr3/pkg4/OpenEV_FW_Tree/FWTools/lib -L/usr/local/lib -L/usr/local/lib -L/usr3/pkg4/OpenEV_FW_Tree/FWTools/lib -L/usr/local/lib -L/usr/local/lib/mysql -L/usr/local/lib -L/usr/lib/gcc-lib/i586-suse-linux/3.3.4 -L/usr/lib/gcc-lib/i586-suse-linux/3.3.4/../../../../i586-suse-linux/lib -L/usr/lib/gcc-lib/i586-suse-linux/3.3.4/../../.. shp2img.o -lmapserver -lgd -lgd -ljpeg -lfreetype -lpng -lz -ljpeg -lfreetype -lpng -lz -lproj -ljpeg -lgdal -lgeos -lgeos_c -lexpat -lxerces-c -lpthread -lpthread -lNCSEcw -lNCSCnet -lNCSUtil -lmfhdf -ldf -logdi31 -ljpeg -lgeotiff -ltiff -lpng -lnetcdf -lgrass5 -lpq -lpq -lz -lpthread -lrt -ldl -lkdu -ldap -lcurl -ldl -lz -lxml2 -lz -lpthread -lm -lpthread -lsqlite3 -lcurl -ldl -lz -lz -lcrypt -lnsl -lm -lz -lxml2 -lz -lm -lm -lstdc++ -lstdc++ -lm -lc -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc-lib/i586-suse-linux/3.3.4/crtend.o /usr/lib/gcc-lib/i586-suse-linux/3.3.4/../../../crtn.o /usr/lib/gcc-lib/i586-suse-linux/3.3.4/../../../../i586-suse-linux/bin/ld: cannot find -lltidsdk collect2: ld returned 1 exit status make: * [shp2img] Error 1

<remove -lltidsdk from compilation >

konserv@nath:~/mapserver_svn/mapserver> ./tmp /usr/lib/gcc-lib/i586-suse-linux/3.3.4/../../../../i586-suse-linux/bin/ld: cannot find -lcfitsio collect2: ld returned 1 exit status

< remove -lcfitsio from compilation >

konserv@nath:~/mapserver_svn/mapserver> ./tmp /usr/lib/gcc-lib/i586-suse-linux/3.3.4/../../../../i586-suse-linux/bin/ld: cannot find -lmysqlclient collect2: ld returned 1 exit status

< remove -lmysqlclient from compilation >

konserv@nath:~/mapserver_svn/mapserver> ./tmp /usr/lib/gcc-lib/i586-suse-linux/3.3.4/../../../../i586-suse-linux/bin/ld: warning: libtiff.so.3, needed by /usr/local/lib/libgdal.so, may conflict with libtiff.so.5 /usr/lib/gcc-lib/i586-suse-linux/3.3.4/../../../../i586-suse-linux/bin/ld: warning: libpq.so.3, needed by /usr/local/lib/libgdal.so, may conflict with libpq.so.4 /usr/lib/gcc-lib/i586-suse-linux/3.3.4/../../../../i586-suse-linux/bin/ld: warning: libpq.so.3, needed by /usr/local/lib/libgdal.so, may conflict with libpq.so.4 ./libmapserver.a(mapfile.o)(.text+0x651d): In function `msUpdateQueryMapFromString': : undefined reference to `msyylex_destroy' ./libmapserver.a(mapfile.o)(.text+0x6ead): In function `msUpdateScalebarFromString': : undefined reference to `msyylex_destroy' ./libmapserver.a(mapfile.o)(.text+0x6f37): In function `msUpdateLabelFromString': : undefined reference to `msyylex_destroy' ./libmapserver.a(mapfile.o)(.text+0x7243): In function `msUpdateLegendFromString': : undefined reference to `msyylex_destroy' ./libmapserver.a(mapfile.o)(.text+0x75c0): In function `msUpdateReferenceMapFromString': : undefined reference to `msyylex_destroy' ./libmapserver.a(mapfile.o)(.text+0x7b1d): more undefined references to `msyylex_destroy' follow collect2: ld returned 1 exit status

comment:3 by tomkralidis, 16 years ago

Cc: tomkralidis added

Jørn: did you have a chance to test this?

comment:4 by oles, 16 years ago

Hi

Jørn is away from work until mid January. I work with Jørn. Requests containing result and time filtering now seem to work. Great!

Still, however, the same kind of behaviour seems to happen when a request contains both "result", "time" and "featureofinterest"-filtering.

Requests containing filtering on "featureofinterest" and "result" also seems to work fine as long as no time filtering is turned on.

comment:5 by tomkralidis, 16 years ago

Assefa: I can reproduce this issue (i.e. time + foi + result). I have added this as the last test in msautotest/wxs/sos.map. A correct response would return 1 om:member, but it returns 2.

comment:6 by tomkralidis, 16 years ago

Looking at this further, (this combination of time + foi + result):

[devgeo:/home/tkralidi/foss4g/mapserver/trunk/msautotest/wxs]$ !ogri   
ogrinfo -al data/obs.shp
INFO: Open of `data/obs.shp'
      using driver `ESRI Shapefile' successful.

Layer name: obs
Geometry: Point
Feature Count: 5
Extent: (-122.000000, 43.000000) - (-75.000000, 49.000000)
Layer SRS WKT:
(unknown)
ID: String (80.0)
STN_ID: String (80.0)
DATETIME: String (80.0)
VALUE: String (80.0)
OGRFeature(obs):0
  ID (String) = 371
  STN_ID (String) = 35
  DATETIME (String) = 2001-10-30T14:24:55Z
  VALUE (String) = 89.9
  POINT (-75 45)

OGRFeature(obs):1
  ID (String) = 377
  STN_ID (String) = 35
  DATETIME (String) = 2002-10-30T18:31:38Z
  VALUE (String) = 93.9
  POINT (-75 45)

OGRFeature(obs):2
  ID (String) = 238
  STN_ID (String) = 2147
  DATETIME (String) = 2007-10-30T08:57:29Z
  VALUE (String) = 103.5
  POINT (-79 43)

OGRFeature(obs):3
  ID (String) = 297
  STN_ID (String) = 2147
  DATETIME (String) = 2003-10-30T07:37:29Z
  VALUE (String) = 93.5
  POINT (-79 43)

OGRFeature(obs):4
  ID (String) = 964
  STN_ID (String) = 604
  DATETIME (String) = 2000-10-30T18:24:39Z
  VALUE (String) = 99.9
  POINT (-122 49)

When I pass the following (per msautotest/wxs/sos.map:

# RUN_PARMS: sos_getobs_time_filter_foi.xml [MAPSERV] QUERY_STRING="map=sos.map&service=SOS&version=1.0.0&request=GetObservation&responseFormat=text/xml; subtype=om/1.0.0&offering=Water&observedproperty=WaterQuality&resul t=<Filter><PropertyIsGreaterThan><PropertyName>value</PropertyName><Literal>89.9</Literal></PropertyIsGreaterThan></Filter>&eventTime=<gml:TimePeriod><gml:beginPosition>1990</gml:beginPosition><gml:endPosition>2003</gml:e ndPosition></gml:TimePeriod>&featureOfInterest=<gml:Envelope><gml:lowerCorner srsName="EPSG:4326">-76 44</gml:lowerCorner><gml:upperCorner srsName="EPSG:4326">-64 47</gml:upperCorner></gml:Envelope>" > [RESULT]

If I break things down, I logically get:

  • Filter: value > 89.9
  • Matching record ids: 377, 238, 297, 964

And then through foi:

  • foi: -76,44,-64,47
  • Matching record ids: 377

And then through time:

  • time = 1990 / 2003
  • Matching record ids: 377

so I should have one record returned in the end. When I try the actual request, I get two records returned (377, 964).

So this tells me that record id 964 is passing the foi when it shouldn't be.

Assefa: any comments here?

comment:7 by assefa, 16 years ago

Tom,

I was able to reproduce this locally. committed fix in r7490.

comment:8 by tomkralidis, 16 years ago

Resolution: fixed
Status: assignedclosed

Thanks for this. I can confirm it works now. I also added a test for this in r7492. Closing as fixed.

Note: See TracTickets for help on using tickets.