[mapserver-users] PostGIS Data Query vs Expression

Gregor Karzelek Gregor.Karzelek at heller-ig.com
Fri Feb 7 08:29:34 PST 2014


Hi,

Personally I would advice to use FILTER for that. FILTER is passed directly to the PostGIS DB as Part of the SQL WHERE and this way you can distinct more easily between "FROM" (DATA) and "WHERE" (FILTER).

For example in combination with OSM one can re-use the DATA for different road categories and distinct which objects to load via FILTER (e.g. FILTER "type in ('primarily', 'primarily_link')" ).


________________________________
Gregor Karzelek
Systemarchitekt
HELLER Ingenieurgesellschaft mbH
Otto-Hesse-Straße 19 / T3
64293 Darmstadt
Tel.: +49 6151 66846-16<tel:+49%206151%2066846-16>
Fax: +49 6151 66846-22<tel:+49%206151%2066846-22>
E-Mail: gregor.karzelek at heller-ig.com<mailto:gregor.karzelek at heller-ig.com>
Internet: www.heller-ig.com<http://www.heller-ig.com/>
Geschäftsführer: Dipl.-Ing. Henning Balck, Dipl.-Ing. Christian Komma
Handelsregister: Amtsgericht Darmstadt HRB 8310
Ust.-Ident.-Nr.: DE 217 293 137<tel:217%20293%20137>

Am 07.02.2014 um 16:51 schrieb "Travis Kirstine" <traviskirstine at gmail.com<mailto:traviskirstine at gmail.com>>:

What is the best practice for using selecting data with a where clause in MapServer using PostGIS connection

i.e.

DATA "the_geom from (SELECT gid, the_geom FROM audience_table WHERE audience = 'Farmers') as foo using unique gid using SRID=4326"

OR

DATA "the_geom from audience_table using SRID=4326"

with a class expression

CLASSITEM audience
....
EXPRESSION 'Farmer'

Thanks

_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org<mailto:mapserver-users at lists.osgeo.org>
http://lists.osgeo.org/mailman/listinfo/mapserver-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20140207/849d9a9b/attachment.html>


More information about the mapserver-users mailing list