[Geoserver-users] Problem with SQL view

Good afternoon,

I am new to GeoServer, and after setting up an SQL view, sending data to the parameters produces no effect.

My setting is as follows:

  1. A PostGIS database with the following table definition (CRTM05, EPSG:5367). The database contains only Point objects with a series of attributes.

  1. An installation of GeoServer ver 2.11.2.

  2. An SQL view as follows:

SQL

SELECT gid, geom, ws_accumulated
FROM ws_cr_volcanoes_ashfall
WHERE
ws_volcano=%VOLCANO%
AND ws_eruption=%ERUPTION%
AND ws_use=%USE%
AND ws_date=%DATE%
AND ws_hour=%HOUR%

  • With the following parametrization and validation:

With the following attribute settings:

My service is setup at:

http://gser.reciem.org:8080/geoserver/reciem/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=reciem:cs_volcano_timeslab&outputFormat=application%2Fjson

What may my mistake be?

Kind regards,


Santiago Núñez-Corrales
Graduate student, Informatics Ph.D. Program
University of Illinois at Urbana-Champaign

+1 (217) 979-9575

Hi, these url's are working?

gser.reciem.org:8080/geoserver/reciem/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=reciem:cs_volcano_timeslab&outputFormat=application/json&viewparams=use:'regular';hour:'02'

{"type":"FeatureCollection","totalFeatures":539....

gser.reciem.org:8080/geoserver/reciem/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=reciem:cs_volcano_timeslab&outputFormat=application/json&viewparams=use:'regular';hour:'03'

{"type":"FeatureCollection","totalFeatures":546,"features":...

note the different number of features.

I had to put the values in quotes, not sure if that is always mandatory

Regards,

Richard Duivenvoorde

On 15-10-17 23:19, Santiago Núñez Corrales wrote:

Good afternoon,

I am new to GeoServer, and after setting up an SQL view, sending data to
the parameters produces no effect.

My setting is as follows:

1. A PostGIS database with the following table definition (CRTM05,
EPSG:5367). The database contains only Point objects with a series of
attributes.

2. An installation of GeoServer ver 2.11.2.

3. An SQL view as follows:

*
*
*SQL*

SELECT gid, geom, ws_accumulated
FROM ws_cr_volcanoes_ashfall
WHERE
ws_volcano=%VOLCANO%
AND ws_eruption=%ERUPTION%
AND ws_use=%USE%
AND ws_date=%DATE%
AND ws_hour=%HOUR%

- With the following parametrization and validation:

With the following attribute settings:

My service is setup at:

http://gser.reciem.org:8080/geoserver/reciem/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=reciem:cs_volcano_timeslab&outputFormat=application%2Fjson
<http://gser.reciem.org:8080/geoserver/reciem/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=reciem:cs_volcano_timeslab&outputFormat=application/json&gt;

What may my mistake be?

Kind regards,

--
Santiago Núñez-Corrales
Graduate student, Informatics Ph.D. Program
University of Illinois at Urbana-Champaign
+1 (217) 979-9575

------------------------------------------------------------------------------
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

Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Hi Richard,

I found some mistakes in how I was setting up the query thanks to your help. However, your comment on the number of features leads me to this question:

My goal is to obtain a single layer of points to the overlay on a map displayed through OpenLayers based on the appropriate parametrization. Is my use of WFS the right choice or should I be setting up something else?

Regards,


Santiago Núñez-Corrales
Graduate student, Informatics Ph.D. Program
University of Illinois at Urbana-Champaign

+1 (217) 979-9575

On Oct 16, 2017, at 2:00 AM, Richard Duivenvoorde <rdmailings@anonymised.com> wrote:

Hi, these url’s are working?

gser.reciem.org:8080/geoserver/reciem/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=reciem:cs_volcano_timeslab&outputFormat=application/json&viewparams=use:‘regular’;hour:‘02’

{“type”:“FeatureCollection”,“totalFeatures”:539…

gser.reciem.org:8080/geoserver/reciem/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=reciem:cs_volcano_timeslab&outputFormat=application/json&viewparams=use:‘regular’;hour:‘03’

{“type”:“FeatureCollection”,“totalFeatures”:546,“features”:…

note the different number of features.

I had to put the values in quotes, not sure if that is always mandatory

Regards,

Richard Duivenvoorde

On 15-10-17 23:19, Santiago Núñez Corrales wrote:

Good afternoon,

I am new to GeoServer, and after setting up an SQL view, sending data to
the parameters produces no effect.

My setting is as follows:

  1. A PostGIS database with the following table definition (CRTM05,
    EPSG:5367). The database contains only Point objects with a series of
    attributes.

  2. An installation of GeoServer ver 2.11.2.

  3. An SQL view as follows:

SQL

SELECT gid, geom, ws_accumulated
FROM ws_cr_volcanoes_ashfall
WHERE
ws_volcano=%VOLCANO%
AND ws_eruption=%ERUPTION%
AND ws_use=%USE%
AND ws_date=%DATE%
AND ws_hour=%HOUR%

  • With the following parametrization and validation:

With the following attribute settings:

My service is setup at:

http://gser.reciem.org:8080/geoserver/reciem/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=reciem:cs_volcano_timeslab&outputFormat=application%2Fjson
<http://gser.reciem.org:8080/geoserver/reciem/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=reciem:cs_volcano_timeslab&outputFormat=application/json>

What may my mistake be?

Kind regards,


Santiago Núñez-Corrales
Graduate student, Informatics Ph.D. Program
University of Illinois at Urbana-Champaign
+1 (217) 979-9575


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:

Geoserver-users@anonymised.comourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

On 16-10-17 18:28, Santiago Núñez Corrales wrote:

I found some mistakes in how I was setting up the query thanks to your
help. However, your comment on the number of features leads me to this
question:

My goal is to obtain a single layer of points to the overlay on a map
displayed through OpenLayers based on the appropriate parametrization.
Is my use of WFS the right choice or should I be setting up something else?

Well could be ok, depends on if you really need vector data (and
attributes) on the client end.

IF it is only viewing, you could consider WMS also (which has the same
query interface if I'm correct).

Regards,

Richard Duivenvoorde