Thanks Andrea.
I found that if I point the ID fiel in double quotes, it works well.
Regards.
[http://www.tragsa.es/SiteCollectionImages/Relaciones%20Institucionales%20(Prensa)/FIRMA%20OUTLOOK/Tragsatec.png]
[http://www.tragsa.es/SiteCollectionImages/Relaciones%20Institucionales%20(Prensa)/FIRMA%20OUTLOOK/cenefa.png]
Pedro Briones Garcia
Grupo Tragsa - SEPI
[http://www.tragsa.es/SiteCollectionImages/Relaciones%20Institucionales%20(Prensa)/FIRMA%20OUTLOOK/Tragsatec_SEPI.png]
Calle Julián Camarillo 6 B - 28037 Madrid
Tel.: 913226489 - 88216 - Fax: 913226005
[email protected]
<mailto:[email protected]>www.tragsa.es <http://www.tragsa.es/>
En beneficio del medio ambiente, imprime este e-mail sólo si realmente es
necesario
For the benefit of the environment, print this e-mail only if you really need
________________________________
De: [email protected] [mailto:[email protected]] En nombre de Andrea
Aime
Enviado el: jueves, 15 de mayo de 2014 9:55
Para: Pedro Briones Garcia
CC: [email protected]
Asunto: Re: [Geoserver-users] Problen sending CQL_FILTER in WFS request based
on an ID column
On Mon, May 12, 2014 at 4:20 PM, Pedro Briones Garcia
<[email protected]<mailto:[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
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
-------------------------------------------------------
**********************************************************************************************
El consumo de papel es perjudicial para el medio ambiente. Por favor, téngalo
en cuenta antes de imprimir este mensaje.
AVISO LEGAL: Este mensaje y sus anexos pueden contener información confidencial
o legalmente protegida. Está dirigido únicamente a la persona o entidad
indicada como destinatarios del mensaje. Si este mensaje le hubiera llegado por
error, por favor elimínelo sin revisarlo ni reenviarlo y notifíquelo
inmediatamente al remitente.
**********************************************************************************************
------------------------------------------------------------------------------
"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