[mapserver-users] PostGIS Data Query vs Expression

2014-02-07 Thread Travis Kirstine
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@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [mapserver-users] PostGIS Data Query vs Expression

2014-02-07 Thread Lime, Steve D (MNIT)
Anything you can do in the data definition limits the number of features sent 
over the network, so that's preferable. Class expressions are generally used to 
sort features you want to draw differently.

Steve

From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Travis Kirstine
Sent: Friday, February 07, 2014 9:51 AM
To: mapserver-users@lists.osgeo.org
Subject: [mapserver-users] PostGIS Data Query vs Expression

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@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [mapserver-users] PostGIS Data Query vs Expression

2014-02-07 Thread Travis Kirstine
thx


On 7 February 2014 11:05, Lime, Steve D (MNIT) wrote:

>  Anything you can do in the data definition limits the number of features
> sent over the network, so that's preferable. Class expressions are
> generally used to sort features you want to draw differently.
>
>
>
> Steve
>
>
>
> *From:* mapserver-users-boun...@lists.osgeo.org [mailto:
> mapserver-users-boun...@lists.osgeo.org] *On Behalf Of *Travis Kirstine
> *Sent:* Friday, February 07, 2014 9:51 AM
> *To:* mapserver-users@lists.osgeo.org
> *Subject:* [mapserver-users] PostGIS Data Query vs Expression
>
>
>
> 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@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [mapserver-users] PostGIS Data Query vs Expression

2014-02-07 Thread Gregor Karzelek
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
Fax: +49 6151 66846-22
E-Mail: gregor.karze...@heller-ig.com
Internet: 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

Am 07.02.2014 um 16:51 schrieb "Travis Kirstine" 
mailto:traviskirst...@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@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users