Ran into this same issue, but with WMS. For me, quoting "id" in the CQL
made it work. This doesn't seem to be required for other fields in the same
table. So maybe just something special for ones named "id"
Jason Newmoyer
Newmoyer Geospatial Solutions
843.606.0424
ja...@newmoyergeospatial.com
On Wed, Mar 7, 2018 at 6:14 PM, Walter Nordmann <wnordm...@gmx.de> wrote:
> got it.
>
> after setting "id" to be the primary key, the query is returning results.
>
> regards
> walter
>
>
>
> Am 07.03.2018 um 19:31 schrieb Walter Nordmann:
>
>> Hi
>>
>> still using geoserver 2.8
>>
>> i'm trying to get some polygons calling my local GeoServer using
>> javascript and ajax.
>>
>> doing this call
>>
>> data: {
>> service : "WFS",
>> version : "1.1.0",
>> request : "GetFeature",
>> outputFormat : "application/json",
>> SrsName : "EPSG:4326",
>> typeName: "osm:Admin Boundaries",
>> cql_filter: "id=403139"
>> },
>>
>> is working fine as can be seen in the log:
>>
>> 2018-03-07 19:11:39,441 INFO [geoserver.wfs] -
>> Request: getFeature
>> service = WFS
>> version = 1.1.0
>> baseUrl = http://localhost:8080/geoserver/
>> query[0]:
>> filter = [ id = 403139 ]
>> srsName = EPSG:4326
>> typeName[0] = {osm.osm.org}Admin Boundaries
>> outputFormat = application/json
>> resultType = results
>> 2018-03-07 19:11:39,442 INFO [wfs.json] - about to encode JSON
>> 2018-03-07 19:11:39,442 DEBUG [geotools.jdbc] - CREATE CONNECTION
>> 2018-03-07 19:11:39,449 DEBUG [geotools.jdbc] - CLOSE CONNECTION
>> 2018-03-07 19:11:39,449 DEBUG [geotools.jdbc] - CREATE CONNECTION
>> 2018-03-07 19:11:39,452 DEBUG [geotools.filter] - exporting SQL
>> ComparisonFilter
>> 2018-03-07 19:11:39,452 DEBUG [geotools.filter] - exporting PropertyName
>> 2018-03-07 19:11:39,452 DEBUG [geotools.filter] - exporting
>> LiteralExpression
>> 2018-03-07 19:11:39,452 DEBUG [geotools.jdbc] - SELECT count(*) FROM
>> (select id,
>> value "name",
>> localname,
>> level admin_level,
>> way
>> from boundaries
>> ) as "vtable" WHERE "id" = 403139
>> 2018-03-07 19:11:39,454 DEBUG [geotools.jdbc] - CLOSE CONNECTION
>> ...
>>
>> "WHERE id=403139" has been added to the query.
>>
>> Changing cql_filter to "id in(403139,1374326)" will give no result.
>>
>> 2018-03-07 19:24:19,377 INFO [geoserver.wfs] -
>> Request: getFeature
>> service = WFS
>> version = 1.1.0
>> baseUrl = http://localhost:8080/geoserver/
>> query[0]:
>> filter = [ 403139, 1374326 ]
>> srsName = EPSG:4326
>> typeName[0] = {osm.osm.org}Admin Boundaries
>> outputFormat = application/json
>> resultType = results
>> 2018-03-07 19:24:19,378 INFO [wfs.json] - about to encode JSON
>> 2018-03-07 19:24:19,378 DEBUG [geotools.jdbc] - CREATE CONNECTION
>> 2018-03-07 19:24:19,384 DEBUG [geotools.jdbc] - CLOSE CONNECTION
>> 2018-03-07 19:24:19,384 TRACE [geotools.core] - condition: Filter.INCLUDE
>> 2018-03-07 19:24:19,384 DEBUG [geotools.jdbc] - CREATE CONNECTION
>> 2018-03-07 19:24:19,385 DEBUG [geotools.jdbc] - SELECT count(*) FROM
>> (select id,
>> value "name",
>> localname,
>> level admin_level,
>> way
>> from boundaries
>> ) as "vtable" WHERE 0 = 1
>> 2018-03-07 19:24:19,386 DEBUG [geotools.jdbc] - CLOSE CONNECTION
>>
>> Strange to me is "filter [403137, 1374326]" without specifing "id".
>>
>> any hints?
>>
>> Regards
>> walter
>>
>> btw: i need the select list because this part will be dynamic later.
>>
>>
>>
>> ------------------------------------------------------------------------------
>>
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> _______________________________________________
>> Geoserver-users mailing list
>>
>> Please make sure you read the following two resources before posting to
>> this list:
>> - Earning your support instead of buying it, but Ian Turton:
>> http://www.ianturton.com/talks/foss4g.html#/
>> - The GeoServer user list posting guidelines:
>> http://geoserver.org/comm/userlist-guidelines.html
>>
>> If you want to request a feature or an improvement, also see this:
>> https://github.com/geoserver/geoserver/wiki/Successfully-req
>> uesting-and-integrating-new-features-and-improvements-in-GeoServer
>>
>>
>> Geoserver-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>>
>
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Geoserver-users mailing list
>
> Please make sure you read the following two resources before posting to
> this list:
> - Earning your support instead of buying it, but Ian Turton:
> http://www.ianturton.com/talks/foss4g.html#/
> - The GeoServer user list posting guidelines:
> http://geoserver.org/comm/userlist-guidelines.html
>
> If you want to request a feature or an improvement, also see this:
> https://github.com/geoserver/geoserver/wiki/Successfully-req
> uesting-and-integrating-new-features-and-improvements-in-GeoServer
>
>
> Geoserver-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Geoserver-users mailing list
Please make sure you read the following two resources before posting to this
list:
- Earning your support instead of buying it, but Ian Turton:
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines:
http://geoserver.org/comm/userlist-guidelines.html
If you want to request a feature or an improvement, also see this:
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users