Hi Gavin,
indeed that's the case, GeoServer would not know how to read and handle
that data type.
A proper implementation likely needs to map that field to a GeoTools
DateRange subclass
(don't get fooled by the name, a java.util.Date is actually a full
timestamp), and then add
support for it in GML/JSON encoding (and/or make it toString to something
sensible, as
many output formats not knowing what that is will just call toString for
it).
If you are interested in having it in GeoServer follow this guidelines:
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer
Cheers
Andrea
On Tue, Oct 10, 2017 at 11:00 PM, Gavin Medley <[email protected]> wrote:
> *UPDATE:* I went to the logs and found this. Looks like Geoserver doesn’t
> support the tstzrange datatype.
>
> 2017-10-10 20:38:03,371 WARN [geotools.jdbc] - Could not find mapping for
> 'date_range', ignoring the column and setting the feature type read only
> 2017-10-10 20:38:57,543 WARN [geotools.jdbc] - Could not find mapping for
> 'active_dates', ignoring the column and setting the feature type read only
>
>
>
> On Tue, Oct 10, 2017 at 2:50 PM, Gavin Medley <[email protected]> wrote:
>
>> Hi all,
>>
>> I am using Geoserver to make a view (Layer) from my PostGIS database
>> using the query below. Unfortunately, I can’t get the tstzrange field to
>> appear. Is there a limitation here that I’m not seeing? I don’t get an
>> error but the field just doesn’t appear in the “Attributes” table after
>> clicking “Refresh.” The query works fine in PGAdmin and in the CLI. What am
>> I missing?
>>
>> WITH
>> metric_types AS
>> (SELECT station, station_type, tstzrange(min(lower(duration)),
>> max(upper(duration))) AS active_dates
>> FROM (
>> select metric_station.name as station,
>> metric_type.name as station_type,
>> duration,
>> ROW_NUMBER() OVER (PARTITION BY metric_station_id, metric_type_id ORDER
>> BY lower(duration) DESC) AS first_row,
>> ROW_NUMBER() OVER (PARTITION BY metric_station_id, metric_type_id ORDER
>> BY lower(duration) ASC) as last_row
>> FROM metrics.active_station_status
>> JOIN metric_type ON metric_type_id = metric_type.id
>> JOIN metric_station ON metric_station_id = metric_station.id)
>> AS station_sub
>> WHERE first_row = 1 or last_row = 1
>> GROUP BY station, station_type)
>> SELECT
>> t3sstations.idstn,
>> metric_types.station,
>> t3sstations.stnname,
>> t3sstations.stnnickname,
>> ST_SETSRID(ST_MAKEPOINT(t3sstations.stnlong, t3sstations.stnlat), 4326)
>> AS lonlat_geom,
>> t3sstations.stnlong,
>> t3sstations.stnlat,
>> t3sstations.stnelev,
>> stationtype.label,
>> t3sstations.stninsdate,
>> metric_types.station_type AS sensor_type,
>> metric_types.active_dates
>> FROM
>> t3sstations
>> INNER JOIN metric_types ON t3sstations.fourcharid=metric_types.station
>> LEFT JOIN stationtype ON stationtype.id = t3sstations.idstationtype
>>
>>
>> --
>> Gavin Medley
>> Software Engineer, UNAVCO
>> 6350 Nautilus Drive
>> Boulder, CO 80301-5394
>> Mobile: 505-819-1270 <(505)%20819-1270>
>> [email protected]
>>
>>
>>
>
>
> --
> Gavin Medley
> Software Engineer, UNAVCO
> 6350 Nautilus Drive
> Boulder, CO 80301-5394
> Mobile: 505-819-1270 <(505)%20819-1270>
> [email protected]
>
>
>
> ------------------------------------------------------------
> ------------------
> 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
>
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
>
--
Regards,
Andrea Aime
==
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.
------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users