koopjs / koop

Transform, query, and download geospatial data on the web.
http://koopjs.github.io
Other
659 stars 127 forks source link

Time aware layers #305

Closed WalterPayne closed 6 years ago

WalterPayne commented 6 years ago

Is it possible to create a time-aware layer in KOOP so that the time-sliders in the various clients are activated when consuming the service?

We can easily handle the form-date and to-date queries in the getData method.

Thank you.

keithfraley commented 6 years ago

the answer is yes. We have been able to build this into our provider.

keithfraley commented 6 years ago

Any comments on the best way to set this up as opposed to hacking it ourselves?

rgwozdz commented 6 years ago

@keithfraley - Looking at the code, I think the functionality it already there. FeatureServer looks in your provider's metadata to see if you have defined a timeInfo property, and if so, uses that in the layer info service (https://github.com/koopjs/FeatureServer/blob/master/src/templates.js#L54). So try including the timeInfo in your metadata with the following spec:

"timeInfo" : {
     "startTimeField" : "<startTimeFieldName>",
     "endTimeField" : "<endTimeFieldName>",
     "trackIdField" : "<trackIdFieldName>",
     "timeExtent" : [<startTime>, <endTime>],
     "timeReference" : {
       "timeZone" : "<timeZone>",
       "respectsDaylightSaving" : <true | false>
     },
     "timeInterval" : <timeInterval>,
     "timeIntervalUnits" : "<timeIntervalUnits>"
}

Spec pulled from here: https://developers.arcgis.com/rest/services-reference/layer-feature-service-.htm

rgwozdz commented 6 years ago

@keithfraley noticed you have had some success with this issue on your provider (https://github.com/koopjs/koop-provider-elasticsearch/issues/11). Was adding time-info to your provider's metadata enough to enable time-sliders in AGOL and Pro?

keithfraley commented 6 years ago

It's more than that, you need to handle the query string parameters for time, it is a separate call then a normal date filter

On Tue, May 8, 2018, 10:54 AM Rich Gwozdz notifications@github.com wrote:

@keithfraley https://github.com/keithfraley noticed you have had some success with this issue on your provider ( koopjs/koop-provider-elasticsearch#11 https://github.com/koopjs/koop-provider-elasticsearch/issues/11). Was adding time-info to your provider's metadata enough to enable time-sliders in AGOL and Pro?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/koopjs/koop/issues/305#issuecomment-387451502, or mute the thread https://github.com/notifications/unsubscribe-auth/ADyxVLdb2XAArVfXCPgovXoefodv0_HRks5twb-_gaJpZM4QCT07 .

rgwozdz commented 6 years ago

Ok, but is that something you're handling in the provider? Trying to determine if this issue can be closed.

keithfraley commented 6 years ago

This was handled at a provider level in our case, but certainly should / could be addressed at a winnow level

On Tue, May 8, 2018, 11:35 AM Rich Gwozdz notifications@github.com wrote:

Ok, but is that something you're handling in the provider? Trying to determine if this issue can be closed.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/koopjs/koop/issues/305#issuecomment-387463952, or mute the thread https://github.com/notifications/unsubscribe-auth/ADyxVAwIeoErZT81Bk_LY-m0aTyGWEguks5twclNgaJpZM4QCT07 .

dhatcher commented 6 years ago

I'd say if it is handled at the winnow level you would have to make it optional. In some cases (like when using a big data store) it is safer and faster to handle it at the provider level to keep from returning thousands of features from the store that don't fit into a given time interval.

keithfraley commented 6 years ago

Ok, cool, regardless, awesome addition

On Tue, May 8, 2018, 2:06 PM Danny Hatcher notifications@github.com wrote:

I'd say if it is handled at the winnow level you would have to make it optional. In some cases (like when using a big data store) it is safer and faster to handle it at the provider level to keep from returning thousands of features from the store that don't fit into a given time interval.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/koopjs/koop/issues/305#issuecomment-387509349, or mute the thread https://github.com/notifications/unsubscribe-auth/ADyxVFR_caG4W-eS-En_oB3NRiMMRIcwks5twezHgaJpZM4QCT07 .

rgwozdz commented 6 years ago

That's a a great point @dhatcher, so I'd say we keep this in the provider. I will close this, but am opening an issue in the koopjs.github.io repo to document an example of this in a provider: https://github.com/koopjs/koopjs.github.io/issues/27