Discussion:
[Geoserver-users] WMS-Time: Handling of null values
Nils Bühner
2017-03-20 10:22:13 UTC
Permalink
Hi all,

i have a question regarding the handling of null values in WMS-Time
requests for the following scenario:

GeoServer 2.10.2
Datastore: PostgreSQL 9.5.6/PostGIS 2.2.1

The requested layer is configured with the following start/end
attributes in its dimensions tab to support the TIME parameter in GetMap
requests:

Attribute: start_date
End Attribute (optional): end_date

When requesting a GetMap with the TIME value
"2016-03-19T00:00:00.000Z/2017-03-20T23:59:59.999Z", the GeoServer
generates the following condition in the WHERE clause:

WHERE ("start_date" <= '2017-03-21' AND "start_date" IS NOT NULL AND
"end_date" >= '2016-03-19' AND "end_date" IS NOT NULL)


Problem/Question:

In the database of our customer, many entries of "end_date" are NULL.
The semantic of a null value is something like "not yet defined" and the
desired behavior would be to handle these null values as "PRESENT" (or
something in the future). The problem is that the condition above
contains "IS NOT NULL", so these entries are never fetched from the
database (and therefore never rendered on a map). It is not possible
(for our customer) to change the data (for example to set the null
values to a value in the far future). So the main question is:

Is there a way/trick to achieve the described behavior?

If not: Is it conceivable to write some lines of code to make such a
behavior configurable in some way (e.g. in the dimensions tab of a
layer)? Or would this disagree with the standard in some way?

Best regards,
Nils
--
Dipl.-Inf. Nils Bühner
— Anwendungsentwickler —
terrestris GmbH & Co. KG
Kölnstr. 99
53111 Bonn

Tel: +49 (0)228 / 96 28 99 -54
Fax: +49 (0)228 / 96 28 99 -57

Email: ***@terrestris.de
Web: http://www.terrestris.de

Amtsgericht Bonn, HRA 6835
Komplementärin: terrestris Verwaltungsgesellschaft mbH
vertreten durch: Hinrich Paulsen, Till Adams
Julian Hollingbery
2017-03-20 10:58:31 UTC
Permalink
Could you create a database view defined by something like
SELECT coalesce(end_date, now()::date) as non_null_end_date FROM ... ?

-----Oprindelig meddelelse-----
Fra: Nils Bühner [mailto:***@terrestris.de]
Sendt: 20. marts 2017 11:22
Til: geoserver-***@lists.sourceforge.net
Emne: [Geoserver-users] WMS-Time: Handling of null values

Hi all,

i have a question regarding the handling of null values in WMS-Time requests for the following scenario:

GeoServer 2.10.2
Datastore: PostgreSQL 9.5.6/PostGIS 2.2.1

The requested layer is configured with the following start/end attributes in its dimensions tab to support the TIME parameter in GetMap
requests:

Attribute: start_date
End Attribute (optional): end_date

When requesting a GetMap with the TIME value "2016-03-19T00:00:00.000Z/2017-03-20T23:59:59.999Z", the GeoServer generates the following condition in the WHERE clause:

WHERE ("start_date" <= '2017-03-21' AND "start_date" IS NOT NULL AND "end_date" >= '2016-03-19' AND "end_date" IS NOT NULL)


Problem/Question:

In the database of our customer, many entries of "end_date" are NULL.
The semantic of a null value is something like "not yet defined" and the
desired behavior would be to handle these null values as "PRESENT" (or
something in the future). The problem is that the condition above
contains "IS NOT NULL", so these entries are never fetched from the
database (and therefore never rendered on a map). It is not possible
(for our customer) to change the data (for example to set the null
values to a value in the far future). So the main question is:

Is there a way/trick to achieve the described behavior?

If not: Is it conceivable to write some lines of code to make such a
behavior configurable in some way (e.g. in the dimensions tab of a
layer)? Or would this disagree with the standard in some way?

Best regards,
Nils




--
Dipl.-Inf. Nils Bühner
— Anwendungsentwickler —
terrestris GmbH & Co. KG
Kölnstr. 99
53111 Bonn

Tel: +49 (0)228 / 96 28 99 -54
Fax: +49 (0)228 / 96 28 99 -57

Email: ***@terrestris.de
Web: http://www.terrestris.de

Amtsgericht Bonn, HRA 6835
Komplementärin: terrestris Verwaltungsgesellschaft mbH
vertreten durch: Hinrich Paulsen, Till Adams


------------------------------------------------------------------------------
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
Geoserver-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Nils Bühner
2017-03-21 08:46:20 UTC
Permalink
Thank you for the idea with the SQL view under the use of coalesce().
We'll give it a try and check if this is a valid solution for our customer.
Post by Julian Hollingbery
Could you create a database view defined by something like
SELECT coalesce(end_date, now()::date) as non_null_end_date FROM ... ?
-----Oprindelig meddelelse-----
Sendt: 20. marts 2017 11:22
Emne: [Geoserver-users] WMS-Time: Handling of null values
Hi all,
GeoServer 2.10.2
Datastore: PostgreSQL 9.5.6/PostGIS 2.2.1
The requested layer is configured with the following start/end attributes in its dimensions tab to support the TIME parameter in GetMap
Attribute: start_date
End Attribute (optional): end_date
WHERE ("start_date" <= '2017-03-21' AND "start_date" IS NOT NULL AND "end_date" >= '2016-03-19' AND "end_date" IS NOT NULL)
In the database of our customer, many entries of "end_date" are NULL.
The semantic of a null value is something like "not yet defined" and the
desired behavior would be to handle these null values as "PRESENT" (or
something in the future). The problem is that the condition above
contains "IS NOT NULL", so these entries are never fetched from the
database (and therefore never rendered on a map). It is not possible
(for our customer) to change the data (for example to set the null
Is there a way/trick to achieve the described behavior?
If not: Is it conceivable to write some lines of code to make such a
behavior configurable in some way (e.g. in the dimensions tab of a
layer)? Or would this disagree with the standard in some way?
Best regards,
Nils
--
Dipl.-Inf. Nils Bühner
— Anwendungsentwickler —
terrestris GmbH & Co. KG
Kölnstr. 99
53111 Bonn

Tel: +49 (0)228 / 96 28 99 -54
Fax: +49 (0)228 / 96 28 99 -57

Email: ***@terrestris.de
Web: http://www.terrestris.de

Amtsgericht Bonn, HRA 6835
Komplementärin: terrestris Verwaltungsgesellschaft mbH
vertreten durch: Hinrich Paulsen, Till Adams
Andrea Aime
2017-03-21 09:01:44 UTC
Permalink
Hi Nils,
are you working against raster or vector data?

Cheers
Andrea
Post by Nils Bühner
Hi all,
i have a question regarding the handling of null values in WMS-Time
GeoServer 2.10.2
Datastore: PostgreSQL 9.5.6/PostGIS 2.2.1
The requested layer is configured with the following start/end
attributes in its dimensions tab to support the TIME parameter in GetMap
Attribute: start_date
End Attribute (optional): end_date
When requesting a GetMap with the TIME value
"2016-03-19T00:00:00.000Z/2017-03-20T23:59:59.999Z", the GeoServer
WHERE ("start_date" <= '2017-03-21' AND "start_date" IS NOT NULL AND
"end_date" >= '2016-03-19' AND "end_date" IS NOT NULL)
In the database of our customer, many entries of "end_date" are NULL.
The semantic of a null value is something like "not yet defined" and the
desired behavior would be to handle these null values as "PRESENT" (or
something in the future). The problem is that the condition above
contains "IS NOT NULL", so these entries are never fetched from the
database (and therefore never rendered on a map). It is not possible
(for our customer) to change the data (for example to set the null
Is there a way/trick to achieve the described behavior?
If not: Is it conceivable to write some lines of code to make such a
behavior configurable in some way (e.g. in the dimensions tab of a
layer)? Or would this disagree with the standard in some way?
Best regards,
Nils
--
Dipl.-Inf. Nils BÃŒhner
— Anwendungsentwickler —
terrestris GmbH & Co. KG
Kölnstr. 99
53111 Bonn
Tel: +49 (0)228 / 96 28 99 -54
Fax: +49 (0)228 / 96 28 99 -57
Web: http://www.terrestris.de
Amtsgericht Bonn, HRA 6835
KomplementÀrin: terrestris Verwaltungsgesellschaft mbH
vertreten durch: Hinrich Paulsen, Till Adams
------------------------------------------------------------
------------------
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
https://lists.sourceforge.net/lists/listinfo/geoserver-users
--
==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.
==

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A
55054 Massarosa (LU)
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

*AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*

Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo Ú consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.



The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.

-------------------------------------------------------
Nils Bühner
2017-03-21 10:04:17 UTC
Permalink
Hi Andrea,

we are only working against vector data here.

Best regards,
Nils
Post by Andrea Aime
Hi Nils,
are you working against raster or vector data?
Cheers
Andrea
Hi all,
i have a question regarding the handling of null values in WMS-Time
GeoServer 2.10.2
Datastore: PostgreSQL 9.5.6/PostGIS 2.2.1
The requested layer is configured with the following start/end
attributes in its dimensions tab to support the TIME parameter in GetMap
Attribute: start_date
End Attribute (optional): end_date
When requesting a GetMap with the TIME value
"2016-03-19T00:00:00.000Z/2017-03-20T23:59:59.999Z", the GeoServer
WHERE ("start_date" <= '2017-03-21' AND "start_date" IS NOT NULL AND
"end_date" >= '2016-03-19' AND "end_date" IS NOT NULL)
In the database of our customer, many entries of "end_date" are NULL.
The semantic of a null value is something like "not yet defined" and the
desired behavior would be to handle these null values as "PRESENT" (or
something in the future). The problem is that the condition above
contains "IS NOT NULL", so these entries are never fetched from the
database (and therefore never rendered on a map). It is not possible
(for our customer) to change the data (for example to set the null
Is there a way/trick to achieve the described behavior?
If not: Is it conceivable to write some lines of code to make such a
behavior configurable in some way (e.g. in the dimensions tab of a
layer)? Or would this disagree with the standard in some way?
Best regards,
Nils
--
Dipl.-Inf. Nils BÃŒhner
— Anwendungsentwickler —
terrestris GmbH & Co. KG
Kölnstr. 99
53111 Bonn
Tel: +49 (0)228 / 96 28 99 -54
Fax: +49 (0)228 / 96 28 99 -57
Web: http://www.terrestris.de
Amtsgericht Bonn, HRA 6835
KomplementÀrin: terrestris Verwaltungsgesellschaft mbH
vertreten durch: Hinrich Paulsen, Till Adams
------------------------------------------------------------------------------
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
https://lists.sourceforge.net/lists/listinfo/geoserver-users
<https://lists.sourceforge.net/lists/listinfo/geoserver-users>
--
==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.
==
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via di Montramito 3/A
55054 Massarosa (LU)
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549
http://www.geo-solutions.it
http://twitter.com/geosolutions_it
*AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*
Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate.
Il loro utilizzo Ú consentito esclusivamente al destinatario del
messaggio, per le finalità indicate nel messaggio stesso. Qualora
riceviate questo messaggio senza esserne il destinatario, Vi preghiamo
cortesemente di darcene notizia via e-mail e di procedere alla
distruzione del messaggio stesso, cancellandolo dal Vostro sistema.
Conservare il messaggio stesso, divulgarlo anche in parte,
distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità
diverse, costituisce comportamento contrario ai principi dettati dal
D.Lgs. 196/2003.
The information in this message and/or attachments, is intended solely
for the attention and use of the named addressee(s) and may be
confidential or proprietary in nature or covered by the provisions of
privacy act (Legislative Decree June, 30 2003, no.196 - Italy's New
Data Protection Code).Any use not in accord with its purpose, any
disclosure, reproduction, copying, distribution, or either
dissemination, either whole or partial, is strictly forbidden except
previous formal approval of the named addressee(s). If you are not the
intended recipient, please contact immediately the sender by
telephone, fax or e-mail and delete the information in this message
that has been received in error. The sender does not give any warranty
or accept liability as the content, accuracy or completeness of sent
messages and accepts no responsibility for changes made after they
were sent or for other risks which arise as a result of e-mail
transmission, viruses, etc.
-------------------------------------------------------
--
Dipl.-Inf. Nils BÃŒhner
— Anwendungsentwickler —
terrestris GmbH & Co. KG
Kölnstr. 99
53111 Bonn

Tel: +49 (0)228 / 96 28 99 -54
Fax: +49 (0)228 / 96 28 99 -57

Email: ***@terrestris.de
Web: http://www.terrestris.de

Amtsgericht Bonn, HRA 6835
KomplementÀrin: terrestris Verwaltungsgesellschaft mbH
vertreten durch: Hinrich Paulsen, Till Adams
Loading...