I think I find a solution, that is using the type of Query.
A Query could construct from a Filter and some property names, like:
Query query = new Query(typeName, Filter.INCLUDE, properties);
And most get features method like SimpleFeatureSoure.getFeatures() could
accept a parameter of Query. So these could satisfy my demand.
Thanks all of your attentions anyway.
On Wed, Apr 18, 2012 at 11:24 AM, Gabriel Roldan <[email protected]>wrote:
> oh, sorry, I thought I was replying to the GeoServer-users mailing
> list, hence I pointed you to the WFS spec.
>
> ok, so you're using GeoTools. The way to limit the returned properties
> is by using a Query object. Check out the GeoTools query tutorial:
> <http://docs.geotools.org/latest/userguide/tutorial/filter/query.html>
>
> Cheers,
> Gabriel
>
> On Wed, Apr 18, 2012 at 12:22 AM, Gabriel Roldan <[email protected]>
> wrote:
> > Filter and CQL are only predicate languages. The WFS spec allows you
> > to chose which feature properties to return by means of the
> > propertyName=<property1>[,propertyN]+ parameter for a GetFeature
> > request using HTTP GET method, or the ogc:PropertyName inside the
> > wfs:Query element in an XML GetFeature request using HTTP POST method
> > (perhaps a mixin of both is allowed? don't recall).
> >
> > In any case, take a look at the demo requests in your geoserver
> > default install, and check out the OGC WFS 1.1 specification [1] for
> > more detail on how to perform data queries.
> >
> > Hope that helps,
> > Gabriel.
> >
> > [1] <http://portal.opengeospatial.org/files/?artifact_id=8339>
> >
> > On Tue, Apr 17, 2012 at 1:50 PM, Zheng Xudong <[email protected]> wrote:
> >> Hi all,
> >>
> >> I use postgis as my spatial database, and the table contains many
> columns,
> >> then when I get the features may lead more overhead of database
> operation
> >> and network communication. But not every columns is really needed for my
> >> each operation. So I want to know, could I choose some columns by
> Filter or
> >> CQL when I getting features? It seems that there are no these type of
> Filter
> >> or CQL syntax, then could I have any other solutions?
> >>
> >> Thanks in advance.
> >>
> >> --
> >> Zheng Xudong
> >> State Key Laboratory of Software Development Environment
> >> School of Computer Science and Engineer, BeiHang University
> >>
> >>
> ------------------------------------------------------------------------------
> >> Better than sec? Nothing is better than sec when it comes to
> >> monitoring Big Data applications. Try Boundary one-second
> >> resolution app monitoring today. Free.
> >> http://p.sf.net/sfu/Boundary-dev2dev
> >> _______________________________________________
> >> GeoTools-GT2-Users mailing list
> >> [email protected]
> >> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
> >>
> >
> >
> >
> > --
> > Gabriel Roldan
> > OpenGeo - http://opengeo.org
> > Expert service straight from the developers.
>
>
>
> --
> Gabriel Roldan
> OpenGeo - http://opengeo.org
> Expert service straight from the developers.
>
--
Zheng Xudong
State Key Laboratory of Software Development Environment
School of Computer Science and Engineer, BeiHang University
------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users