ngageoint / elasticgeo

ElasticGeo provides a GeoTools data store that allows geospatial features from an Elasticsearch index to be published via OGC services using GeoServer.
GNU General Public License v3.0
168 stars 85 forks source link

Elasticgeo Geoserver Time and Elevation Enabling Support #11

Closed devacarter closed 8 years ago

devacarter commented 8 years ago

Does Geoserver support Time enabling for Elasticsearch stores when using the elasticgeo plugin? The Geoserver version is 2.7.2.

What is the proper setup when Enabling Time and Elevation and which date format should be used. Please also provide example URL calls if possible. If you are able to get it working please provide the expected outcome as well as screen captures of the setup.

Issue: There seems to be an issue where a layer is setup without Time or Elevation enabled, then the data appears correctly when viewing. However, once the Time is enabled, I receive an error message that says Rendering process failed. I've modified the ElasticSearch data Type for DATE to multiple different date and time formats and have not been successful in having the Time Enable to work.

Please see below for Time enable Example and error message:

github1

<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE ServiceExceptionReport SYSTEM "IP:PORT/geoserver/schemas/wms/1.1.1/WMS_exception_1_1_1.dtd"> Rendering process failed java.io.IOException: Error executing query search Error executing query search

*just to note ive replaced the actual IP and PORT with placeholder IP:PORT

Thank you in advance for the help.

sjudeng commented 8 years ago

I haven't tried enabling the Time dimension in GeoServer for Elasticsearch layers. I'll try to take a look. Datetime fields themselves should be supported. The format used is taken from the Elasticsearch mapping, if defined, or dateOptionalTime otherwise. In the meantime I'd welcome a pull request if you find the issue first. Take a look at the DescribeFeatureType output for the layer and confirm the field type is Date.

IP:PORT/geoserver/ows?service=wfs&version=1.0.0&request=DescribeFeatureType&typeName=your_workspace:your_layer_name

If you have access to the server you can also turn logging up and see the request being sent to the server that's causing the error. Add the below line to your logging file (e.g. data/DEFAULT_LOGGING.properties, etc.).

log4j.category.mil.nga.giat.data.elasticsearch=DEBUG

You can confirm the logging file being used through GeoServer global settings.

GeoServer global settings

rastafford commented 8 years ago

I have been looking into this same issue, and what I have found is that the ISO 8601 DateTime format that GeoServer sends seems to be causing an issue. I get an ElasticsearchParseException of Invalid format: "2008-12-21T00:00:00.000Z" is malformed at "Z". Is there a specific date format that ElasticGeo is expecting? Or is it possible that I can add a parser to the ElasticGeo source code to handle this situation?

Any advice/help is greatly appreciated! Thank you

sjudeng commented 8 years ago

It wasn't using the custom date format when building these filters. The previous commit should fix this. Thanks for reporting the issue.

rastafford commented 8 years ago

I was able to get the new build (thank you) and I am no longer getting those errors. However, when I enable the time dimension, I still don't get any data. If I have it disabled, the data comes back fine. I am using the date_hour_minute_second_millis format for my dates in elasticsearch. Could this still be the problem?

sjudeng commented 8 years ago

Are you querying for exact values or a time range? Could it be a timezone issue? Try a time range that covers your data, e.g 'TIME=2015-01/2016-01'. If that doesn't help and you have access to the server, try enabling logging as described above to see the requests being sent to Elasticsearch.

rastafford commented 8 years ago

I am doing both. Actually, initially, I am not using any time at all. I am just clicking the OpenLayers option under Layers Preview, and I was hoping with no time it would just return everything (I am guessing that is probably a wrong assumption?)

I will check what it is sending to ElasticSearch. Like I said, I turned on all of the GeoServer logging and nothing is coming back weird. I will let you know.

Thank you again for your help and your quick response.

sjudeng commented 8 years ago

Make sure to add "log4j.category.mil.nga.giat.data.elasticsearch=DEBUG" to the relevant logging.properties file.

rastafford commented 8 years ago

Yep, I got that. And you called it with the time formatting. I had to remove the PT1H at the end of the WMS time (not sure why that would make it return nothing), and the data I was looking at in the preview window was converting the time from zulu to EST. So with all of that squared away, I am well on my way. Thank you again for all of your help!