Using GeoServer I want to deliver some objects/features with WFS and WMS. The objects and their attributes have a date range during which they are valid. Say, we have street lamps and each street lamp has an ID
, POINT (geom)
, start_date
, end_date
.
The WMS and WFS request can use the time
parameter to filter the resulting objects (see WFS GetFeature with time, WMS GetMap with time). Using the time filter, only the street lamps that a within start_date
and end_date
would be returned by GeoServer .
However, I now saw that for time
the respective time column must be stored with a date
type. That is, in geoserver one cannot configure start or end date columns for a WMS or WFS layer. It is only possible to configure a single date column (same for MapServer).
What's the best way to store my street lamps in PostgreSQL/PostGIS? For a lamp that was created on Jan 01, 2014 and destroyed on Jan 20, 2014 would I need to have 20 data sets in my database:
ID GEOM DATE
01 xy 2014年01月01日
01 xy 2014年01月02日
...
01 xy 2014年01月19日
01 xy 2014年01月20日
Is there a way to store date ranges in PostgreSQL/PostGIS that can be used by GeoServer? Or is this impossible?
1 Answer 1
In GeoServer you can specify a start and an end date column, see the documentation at http://docs.geoserver.org/latest/en/user/webadmin/data/layers.html#edit-dimensions.
All you need is two date columns i.e. two columns with date
datatype in your database.
Explore related questions
See similar questions with these tags.
tsrange
data type, but just a pair of timestamps would be quite sufficient in a pinch.tsrange
as GeoServer (and GeoTools) have to function over a lot of datastores