Hi all.
I’m trying to apply filter WITHIN to WMS layer from OpenLayers:
WITHIN(the_geom, POLYGON((35 49, 35 51, 39 51, 39 49, 35 49)))
Everything works fine until i use PostGIS layer instead of Shapefile . Then i need to use the “geom” field.
So the question is how can i know what field to use if i have both PostGIS and Shapefile layers?
WITHIN(the_geom, POLYGON((35 49, 35 51, 39 51, 39 49, 35 49)))
I didnt find a good answer to this. If you are using WFS (DWITHIN Filter), then its managed for you, but if you are using CQL (which I do for script protocol), then have to figure this out from the getCapabilities document.
--
Phil Scadden, Senior Scientist GNS Science Ltd 764 Cumberland St, Private Bag 1930, Dunedin, New Zealand Ph +64 3 4799663, fax +64 3 477 5232
Notice: This email and any attachments are confidential.
If received in error please destroy and immediately notify us.
Do not copy or disclose the contents.
On Mon, Apr 1, 2013 at 11:34 AM, Сергей Колосов <sergey.kolosof@anonymised.com>wrote:
Hi all.
I'm trying to apply filter WITHIN to WMS layer from OpenLayers:
WITHIN(the_geom, POLYGON((35 49, 35 51, 39 51, 39 49, 35 49)))
Everything works fine until i use PostGIS layer instead of Shapefile .
Then i need to use the "geom" field.
So the question is how can i know what field to use if i have both PostGIS
and Shapefile layers?
Each sources names the fields in a slightly different way. You have to
check the results of
the WFS DescribeFeatureType to see the names of the attributes, or use the
list of attributes in the
layer edit page.
In the particular case, "the_geom" is just a conventional name for
shapefiles (the geometry has
no name there), for postgis it's the name of the column that has the
geometry, so it can have any
name
Cheers
Andrea
--
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549
http://www.geo-solutions.it
http://twitter.com/geosolutions_it
-------------------------------------------------------
Yeah, i expected so. Thanks!
···
2013/4/2 Andrea Aime <andrea.aime@anonymised.com>
On Mon, Apr 1, 2013 at 11:34 AM, Сергей Колосов <sergey.kolosof@anonymised.com> wrote:
Hi all.
I’m trying to apply filter WITHIN to WMS layer from OpenLayers:
WITHIN(the_geom, POLYGON((35 49, 35 51, 39 51, 39 49, 35 49)))
Everything works fine until i use PostGIS layer instead of Shapefile . Then i need to use the “geom” field.
So the question is how can i know what field to use if i have both PostGIS and Shapefile layers?
Each sources names the fields in a slightly different way. You have to check the results of
the WFS DescribeFeatureType to see the names of the attributes, or use the list of attributes in the
layer edit page.
In the particular case, “the_geom” is just a conventional name for shapefiles (the geometry has
no name there), for postgis it’s the name of the column that has the geometry, so it can have any
name
Cheers
Andrea
–
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549
http://www.geo-solutions.it
http://twitter.com/geosolutions_it