ArcGIS Enterprise 10.9 Datetime Handling for Dynamic Query Layer

2684
17
Jump to solution
10-13-2021 03:58 PM
cle444
by
Occasional Contributor

Call for ArcGIS Enterprise experts! This is a queston about UTC and local time handling when publishing registered dynamic query layers to Enterprise.

Use case:
Publish a map image service that contains XY event layer that is based on a referenced SQL query table. The SQL query table is a simple SELECT query with a field of datetime data type. The datetime value is stored as a plain local time value without timezone and daylight saving information.

When pulishing to ArcGIS Enterprise via ArcGIS Pro Share as Web Layer, the local time zone and daylight saving option are configured in the sharing wizard.

The issue:
ArcGIS Enterprise doesn't respect the time zone and daylight saving configuration for such dynamic layers. Instead, it treats the value as UTC and convert it to local e.g. adding 13hours for NZ daylight saving time.

However, there is no issue if published from a static feature class from a file gdb. Extactly same data and same publish process.

Software:
Client - ArcGIS Pro 2.8
Server - ArcGIS Enterprise 10.9

Test: Publish a map with two layers of exactly same data, one from registered feature class and one based on a SQL query table.

1. Prepare workspace as below. Both layers are registered on the target ArcGIS Server.

cle444_0-1634164994882.png

2. Check value from local ArcGIS Pro using identify and popup. Same value 13/10/2021, 12:33pm for both layers.

cle444_1-1634165044760.png

3. Publish as map image layer.

cle444_2-1634165173060.png

configure timezone and daylight saving

cle444_3-1634165222309.png

4. Publish to Enterprise is successful. Check on map viewer from Portal.

cle444_4-1634165375946.png

Question:
With timezone and daylight saving configured during publish process, why Enterprise treats feature class layer correctly but not Event layer based on SQL query table?

For the query table and XY event layer, no matter what timezone you choose during the publish stage, NZ+12:00 or UTC or <None> or any other, Enterprise always treats it as UTC and converts it to local time, in my case, +1300.

Any ideas and insights would be much appreciated!

Thanks,
Hua

0 Kudos
17 Replies
TanuHoque
Esri Regular Contributor

 


... but Oracle is quite different than SQL and they have what seems to be no easy way to create geometry on the fly with sdo_geometry...


I'm not an expert in Oracle by any means... still want to pass it to you... did you try this and not work for you?

 

select 
   objectid, 
   SDO_GEOMETRY(2001, 3857, MDSYS.SDO_POINT_TYPE( x_coord, y_coord, NULL), NULL, NULL)  as shape_derived, 
   /* the 2nd parameter is the id for coordinate system; 3857 is the wkid for WGS 1984 Web Mercator (auxiliary sphere) projection */
   date_time_field 
from myTable 
WHERE aFld = 'value'

 

 

0 Kudos
TanuHoque
Esri Regular Contributor

Thanks @cle444 . I'm glad it worked for you.

I don't have answers for all the questions you have asked at least not at the detail level you hoped for. Let me try.

is it a Pro issue rather than the Enterprise issue?

The bug you ran into is a map service bug on the Enterprise side.

Is the 'Make XY Event Layer' a helper method that can handle different database technologies?

If I recall correctly, it is not.

For the SQL server, what you provided is how 'Make XY Event Layer' works behind the scene?

No, it doesn't. 'Make XY Event Layer' is a complete different implementation.

What is the main difference between the two layer types?

If I understands correctly, a 'XY Event Layer' reads rows from the table and generates geometries using x/y coordinates on the client side. Whereas the approach that I provided generates the geometries at the database level. Pro/map service simply gets the geometries (just like for any other query layer or feature class) and draws them.

In what scenarios you would use a query feature class layer instead of an XY Event layer, and vice versa?

Unfortunately I don't have any answer for this 😞 I need to think through, if I find any I will reply back here.

As you might have figured already, functionaly they are pretty similar. Of course one draw back for the query-layer approach is that you need to know sql and database specific spatial functions. Itonly works when your data are stored in an enterprise database. This approach wouldn't work for file gdb or shape files etc.

 

hope you will find this helpful!

cle444
by
Occasional Contributor

Great stuff! My major concern is performance but looking at the page loading profiles, not much difference that I can tell. Really good to know what's happening under the hood. Thanks for sharing the knowledge!

TanuHoque
Esri Regular Contributor

hmm... You might see performance issue with very large tables since they don't have any spatial index and Pro/map service makes queries with spatial filter.

 

If I recall correctly, XY Event Layer actually does try to mimic the spatial filter using x/y coordinate fields -- something like where x_coordinate >= xmin and x_coordinate <= xmax and y_coordinate >= ymin and y_coordinate <= ymax.

That said, when those x/y coord fields don't have indices, I'm not sure how the query will perform.

cle444
by
Occasional Contributor

@TanuHoque Greetings. I am revisiting this thread just wondering if this bug is resolved in 10.9.1? If not, is there a known bug page that we can track? This is due to our GIS professionals tend to use this function more. Query feature layer on a SQL spatial view also has the same problem.

Thanks,
Hua

0 Kudos
TanuHoque
Esri Regular Contributor

hi @cle444 

Unfortunately it was too late to have it fixed for 10.9.1.

That said, we have it in for the next release. Fingers crossed for fixing it before it releases -- hopefully at the end of Q2 or the beginning of Q3. The bug is still internal. Let me see if I can make it public and if I do, I will share that with you.

0 Kudos
TanuHoque
Esri Regular Contributor

BUG-000147165

0 Kudos
TanuHoque
Esri Regular Contributor

also just to let you know that this is something got fixed in ArcGIS Enterprise 11.0 release