Re: [mapserver-users] ms7 How to use FILTER
Days ago I voted to keep native filters in MS7 via a processing instruction. It's value is a SQL expression that is ANDed to every query MS builds. The intended use is mainly to build dynamic filters when using MapScript or the C API. This avoids parsing and modifying the DATA statement. So into DATA goes the main query including subqueries and static WHERE clauses. The FILTER statement contains a MapServer expression either from MAP file, build dynamically by the CGI (e.g. a translated WFS filter) or set via MapScript. HTH -Ursprüngliche Nachricht- Von: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users- boun...@lists.osgeo.org] Im Auftrag von Lime, Steve D (MNIT) Gesendet: Donnerstag, 26. März 2015 15:56 An: steve.tout...@inspq.qc.ca Cc: mapserver-users@lists.osgeo.org Betreff: Re: [mapserver-users] ms7 How to use FILTER With Postgres I'd use the DATA statement. I don't use Oracle so someone else might be in a better position to comment. From: steve.tout...@inspq.qc.ca [mailto:steve.tout...@inspq.qc.ca] Sent: Thursday, March 26, 2015 9:27 AM To: Lime, Steve D (MNIT) Cc: mapserver-users@lists.osgeo.org Subject: RE: [mapserver-users] ms7 How to use FILTER Thanks Steve, yes it helps! If an SQL query is needed, would you suggest to do it in the DATA statement as a subquery or use PROCESSING native_filter=native SQL string steve Lime, Steve D (MNIT) steve.l...@state.mn.us 2015-03-26 10:20 A steve.tout...@inspq.qc.ca steve.tout...@inspq.qc.ca, mapserver- us...@lists.osgeo.org mapserver-users@lists.osgeo.org cc Objet RE: [mapserver-users] ms7 How to use FILTER MapServer FILTERs are now only written using MapServer expression syntax (e.g. ([someitem] != someval)). Drivers can support translation capabilities to create native SQL under the hood. This was done to standardize the syntax across all drivers. Prior to 7.0 the syntax varied by driver. In addition, FILTER values are preserved when used with WFS or native MapServer attribute queries. With database backends there has been little reason to use FILTERs since you could often just extend the DATA statement. Note that if need to you can still define a native SQL independently of the DATA statement using the processing tag native_filter, for example: PROCESSING native_filter=native SQL string This is also preserved with WFS. Does this help? Steve From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users- boun...@lists.osgeo.org mailto:mapserver-users-boun...@lists.osgeo.org ] On Behalf Of steve.tout...@inspq.qc.ca Sent: Thursday, March 26, 2015 8:20 AM To: mapserver-users@lists.osgeo.org Subject: [mapserver-users] ms7 How to use FILTER I'm confused on how to use FILTER when datasource is postgis or Oracle Spatial (Native Connection) In an old thread, I was told to not use FILTER, but use a WHERE clause in the Data statement. In the ms7 Mapfile-Layer-Data doc, I see for Oracle Note that there are important performance impacts when using spatial subqueries however. Try using MapServer's FILTER http://mapserver.org/mapfile/layer.html#filter whenever possible instead. I remember I had a bug with MS6 when using FILTER using WFS. A getfeature on the layer with a spatial or logical filter, the FILTEr in the mapfile was overwritten. Please, how should we define/use FILTER int a mapfile with postgis and also oracle (using native connection, not ogr)? THANKS! ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] ms7 How to use FILTER
I'm confused on how to use FILTER when datasource is postgis or Oracle Spatial (Native Connection) In an old thread, I was told to not use FILTER, but use a WHERE clause in the Data statement. In the ms7 Mapfile-Layer-Data doc, I see for Oracle Note that there are important performance impacts when using spatial subqueries however. Try using MapServer?s FILTER whenever possible instead. I remember I had a bug with MS6 when using FILTER using WFS. A getfeature on the layer with a spatial or logical filter, the FILTEr in the mapfile was overwritten. Please, how should we define/use FILTER int a mapfile with postgis and also oracle (using native connection, not ogr)? THANKS! ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] ms7 How to use FILTER
Thanks Steve, yes it helps! If an SQL query is needed, would you suggest to do it in the DATA statement as a subquery or use PROCESSING ?native_filter=native SQL string? steve Lime, Steve D (MNIT) steve.l...@state.mn.us 2015-03-26 10:20 A steve.tout...@inspq.qc.ca steve.tout...@inspq.qc.ca, mapserver-users@lists.osgeo.org mapserver-users@lists.osgeo.org cc Objet RE: [mapserver-users] ms7 How to use FILTER MapServer FILTERs are now only written using MapServer expression syntax (e.g. (?[someitem]? != ?someval?)). Drivers can support translation capabilities to create native SQL under the hood. This was done to standardize the syntax across all drivers. Prior to 7.0 the syntax varied by driver. In addition, FILTER values are preserved when used with WFS or native MapServer attribute queries. With database backends there has been little reason to use FILTERs since you could often just extend the DATA statement. Note that if need to you can still define a native SQL independently of the DATA statement using the processing tag ?native_filter?, for example: PROCESSING ?native_filter=native SQL string? This is also preserved with WFS. Does this help? Steve From: mapserver-users-boun...@lists.osgeo.org [ mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of steve.tout...@inspq.qc.ca Sent: Thursday, March 26, 2015 8:20 AM To: mapserver-users@lists.osgeo.org Subject: [mapserver-users] ms7 How to use FILTER I'm confused on how to use FILTER when datasource is postgis or Oracle Spatial (Native Connection) In an old thread, I was told to not use FILTER, but use a WHERE clause in the Data statement. In the ms7 Mapfile-Layer-Data doc, I see for Oracle Note that there are important performance impacts when using spatial subqueries however. Try using MapServer?s FILTER whenever possible instead. I remember I had a bug with MS6 when using FILTER using WFS. A getfeature on the layer with a spatial or logical filter, the FILTEr in the mapfile was overwritten. Please, how should we define/use FILTER int a mapfile with postgis and also oracle (using native connection, not ogr)? THANKS! ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] ms7 How to use FILTER
With Postgres I'd use the DATA statement. I don't use Oracle so someone else might be in a better position to comment. From: steve.tout...@inspq.qc.ca [mailto:steve.tout...@inspq.qc.ca] Sent: Thursday, March 26, 2015 9:27 AM To: Lime, Steve D (MNIT) Cc: mapserver-users@lists.osgeo.org Subject: RE: [mapserver-users] ms7 How to use FILTER Thanks Steve, yes it helps! If an SQL query is needed, would you suggest to do it in the DATA statement as a subquery or use PROCESSING native_filter=native SQL string steve Lime, Steve D (MNIT) steve.l...@state.mn.usmailto:steve.l...@state.mn.us 2015-03-26 10:20 A steve.tout...@inspq.qc.camailto:steve.tout...@inspq.qc.ca steve.tout...@inspq.qc.camailto:steve.tout...@inspq.qc.ca, mapserver-users@lists.osgeo.orgmailto:mapserver-users@lists.osgeo.org mapserver-users@lists.osgeo.orgmailto:mapserver-users@lists.osgeo.org cc Objet RE: [mapserver-users] ms7 How to use FILTER MapServer FILTERs are now only written using MapServer expression syntax (e.g. ([someitem] != someval)). Drivers can support translation capabilities to create native SQL under the hood. This was done to standardize the syntax across all drivers. Prior to 7.0 the syntax varied by driver. In addition, FILTER values are preserved when used with WFS or native MapServer attribute queries. With database backends there has been little reason to use FILTERs since you could often just extend the DATA statement. Note that if need to you can still define a native SQL independently of the DATA statement using the processing tag native_filter, for example: PROCESSING native_filter=native SQL string This is also preserved with WFS. Does this help? Steve From: mapserver-users-boun...@lists.osgeo.orgmailto:mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of steve.tout...@inspq.qc.camailto:steve.tout...@inspq.qc.ca Sent: Thursday, March 26, 2015 8:20 AM To: mapserver-users@lists.osgeo.orgmailto:mapserver-users@lists.osgeo.org Subject: [mapserver-users] ms7 How to use FILTER I'm confused on how to use FILTER when datasource is postgis or Oracle Spatial (Native Connection) In an old thread, I was told to not use FILTER, but use a WHERE clause in the Data statement. In the ms7 Mapfile-Layer-Data doc, I see for Oracle Note that there are important performance impacts when using spatial subqueries however. Try using MapServer's FILTERhttp://mapserver.org/mapfile/layer.html#filter whenever possible instead. I remember I had a bug with MS6 when using FILTER using WFS. A getfeature on the layer with a spatial or logical filter, the FILTEr in the mapfile was overwritten. Please, how should we define/use FILTER int a mapfile with postgis and also oracle (using native connection, not ogr)? THANKS! ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users