On Mon, May 12, 2014 at 4:20 PM, Pedro Briones Garcia <[email protected]> wrote:

>  Hi all.
>
>
>
> I have a problem when making a WFS request to a GeoServer layer (
> *ccaa_4326*). I need to make a selection of polygons based on a column
> called *ID*, but in this case I receive an error message. These are the
> layer feature columns:
>
>
>
> the_geom
>
> MultiPolygon
>
> true
>
> 0/1
>
> AREA
>
> Double
>
> true
>
> 0/1
>
> PERIMETER
>
> Double
>
> true
>
> 0/1
>
> *CCAA_ID*
>
> Long
>
> true
>
> 0/1
>
> CCAA
>
> Integer
>
> true
>
> 0/1
>
> NOMBRE
>
> String
>
> true
>
> 0/1
>
> *ID*
>
> Integer
>
> true
>
> 0/1
>
>
>
>
>
> The next example works fine: I make a request to *ccaa_4326* layer. I
> define a condition based in *CCAA_ID *column:
>
>
> http://pc-pbg:8080/geoserver/CursoIDE/wfs?request=GetFeature&service=WFS&version=1.0.0&typeName=CursoIDE:
> *ccaa_4326*&outputFormat=json&cql_filter=*CCAA_ID*
> +IN+('1','2')&page=1&start=0&limit=25<http://pc-pbg:8080/geoserver/CursoIDE/wfs?request=GetFeature&service=WFS&version=1.0.0&typeName=CursoIDE:ccaa_4326&outputFormat=json&cql_filter=CCAA_ID+IN+('1','2')&page=1&start=0&limit=25>
>
>
>
>
>
> In the second example, the request is the same but the column has a
> different name: in this case its name is *ID*, but is the same type as
> *CCAA_ID*. The result is an error:
>
>
> http://pc-pbg:8080/geoserver/CursoIDE/wfs?request=GetFeature&service=WFS&version=1.0.0&typeName=CursoIDE:ccaa_4326&outputFormat=json&cql_filter=
> *ID*+IN+('1','2')&page=1&start=0&limit=25<http://pc-pbg:8080/geoserver/CursoIDE/wfs?request=GetFeature&service=WFS&version=1.0.0&typeName=CursoIDE:ccaa_4326&outputFormat=json&cql_filter=ID+IN+(%271%27,%272%27)&page=1&start=0&limit=25>
>
>
>
> The result: an error: {"type":"FeatureCollection","features":[]}
>
>
>

This is not an error, it's just an empty result.
Where are your information stored, in a database? If so, you should check
what sql is being generated by GeoServer by
enabling the "geotools developer logging" logging profile.

Also, if the column is numeric, I would expect ID in (1, 2) to be the
correct syntax

Cehers
Andrea

-- 
==
Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
for more information.
==

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

-------------------------------------------------------
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to