POST
|
Hey All, Just wondering if there are ramifications for altering the default timezone within the postgresql.conf file in an ArcGIS Datastore deployment? The reason is as follows: We need to be able to set a query on a field in a hosted feature layer, which makes use of CURRENT_TIMESTAMP. We're using ArcGIS Online Assistant to alter the default query within the Web Map to be (we understand that this is non-standard): This query is saying, when the current time passes the expiry datetime field, then we will no longer display the feature in the Web Map. The above query works in a Web Map, when using AGOL, and my guess is this is because the underlying DB storing the data in AGOL returns CURRENT_TIMESTAMP as UTC. Whereas in a Datastore deployment, CURRENT_TIMESTAMP returns in the local timezone where the database was installed. This is verified by running the query manually against the Datastore PostgreSQL DB, or checking the postgresql.conf file. The problem is that features appear to store their datetime data as UTC within the database and the conversion to local is done within Portal itself (verified by querying the ArcGIS Server REST endpoint). Therefore the above query is querying the 'expiry' field as UTC against CURRENT_TIMESTAMP in the local timezone, which does not produce the correct results. If we edit the postgresql.conf file and set the timezone to UTC: then CURRENT_TIMESTAMP does return as UTC, which will create a valid query above. Is there a reason the DB is deployed using the local timezone settings? and, what are the ramifications for altering this setting to be UTC? Cheers, Jordan
... View more
07-09-2018
11:54 PM
|
0
|
0
|
558
|
POST
|
Hi Shaning, If you have access to an IServerObjectHelper object, you can then get an IMapLayerInfos object, which is a collection of IMapLayerInfo. The only way I've done this is when using SOI and SOE's and in that case you get an IServerObjectHelper instantiated when the SOI/SOE starts up. /// <summary>
/// IServerObjectExtension implementation
/// This method is called when then service with this SOI is started
/// </summary>
/// <param name="pSOH"></param>
public void Init(IServerObjectHelper pSOH)
{
IMapLayerInfos layerInfos = pSOH.MapServer.GetServerInfo(pSOH.MapServer.DefaultMapName).MapLayerInfos;
// Now you can iterate through layerInfos
IMapLayerInfo layerInfo;
for (int i = 0; i < layerInfos.Count; i++)
{
layerInfo = layerInfos.get_Element(i);
}
} Not sure how to get access to the IServerObjectHelper object if you're not writing an SOI or SOE. Perhaps someone else can fill in that part! Cheers, Jordan
... View more
09-06-2017
09:13 PM
|
0
|
0
|
811
|
POST
|
Hey Matthieu, Check that you're not using 'bolder' as the font-weight. I found that this broke the printing: https://community.esri.com/thread/198924-supported-textsymbol-properties-in-print I also wonder if there are some other settings which break the printing... Cheers, Jordan
... View more
07-27-2017
09:01 PM
|
0
|
0
|
249
|
POST
|
Hey, I've been building a simple app to print out some custom graphics which have been placed on the screen. We are placing two graphics, one to symbolise the point and another to symbolise the text label for that point (as a TextSymbol). When we try to print this using the Print widget, or PrintTask, some of the properties the 4.4 API provides for TextSymbol, seem to break in the Export Web Map Task and you end up with a default TextSymbol, which is black, has no offset, etc etc. Example: One of the properties which appears to be causing problems is the font - weight, when it is set to 'bolder'. Which is how I had it set for the example above. If I change this property to be 'bold', then the map prints as expected: What I'm wondering is, is there a list of the properties which are supported and which are not supported in the Printing? Not just for TextSymbol, but also for the other symbol types? Personally, I think there should be some mention of this in the API (if it truly is an issue). Especially since the example provided in the API for TextSymbol uses 'bolder', as the font - weight. Cheers, Jordan
... View more
07-26-2017
06:14 PM
|
0
|
0
|
623
|
POST
|
Hey Anton, You're close. That code block you pasted in is the key to this. That defines the structure of a Graphic object, which your JSON needs to conform to, in order to create a proper Graphic. A Graphic is an object which stores both Geometry (a Point, Line, Polygon etc.) and Attributes for that graphic. Also note that you will need to have some kind of unique identifier in your attributes. Generally Esri calls this the OBJECTID, but it can be called anything, as long as the name of the unique ID field is specified when defining the Feature Layer fields (see example below). You cannot populate the Geometry using a street address, you need to convert this to x, y coordinates somehow first. To do this, you'll need to use a Geocoder. Esri has a Geocoder available, but you need to sign up as a Developer in order to get access to it: Geocoding and Place Search | ArcGIS for Developers . This is also going to add another layer of complexity to your code. You're correct, you need to use your address, company name etc. as the attributes. Here is an example for you, which is doing most of what you want, except for the geocoding to get x, y coordinates from a street address: JS Bin - Collaborative JavaScript Debugging If you decide to use the Esri Geocoder above, it shouldn't be to hard to plug that in and create the Geometry. Cheers, Jordan
... View more
07-09-2017
05:58 PM
|
1
|
5
|
3985
|
POST
|
Hey Anton, This is a pretty broad question. Firstly, to create a Feature Layer, you first need to create a list of Graphic Objects, which the Feature Layer expects, e.g.: [{ geometry: new Point({ x: -100, y: 38 }), attributes: { ObjectID: 1, DepArpt: "KATL", MsgTime: Date.now(), FltId: "UAL1" } }, { geometry: new Point({ x: -77, y: 35 }), attributes: { ObjectID: 2, DepArpt: "KZBW", MsgTime: Date.now(), FltId: "SW999" } }] Each feature will need to be a Graphic object (the attributes above are just examples). You can then use the Feature Layer's source property to set the layers graphics to the above list of features. See this part of the API docs: FeatureLayer | API Reference | ArcGIS API for JavaScript 4. Or, if you have ArcGIS Server, or a Hosted Feature Layer in ArcGIS Online or Portal, you can point your Feature Layer directly to those services. Secondly, the rendererJsonUtils is the wrong thing to be using here to convert your JSON into features. A Renderer in the JavaScript API, is used to define how features are visually represented, not the feature object itself. To parse your JSON into features, especially through your own Web Server API, there are numerous ways to achieve this. You could use the Graphic fromJSON method on each feature and store the Graphic object in an array, then use that array as your source for the Feature Layer. Alternatively, you could get your Web Server API to return more specific formatting on your features and then use the FeatureSet fromJSON method, then use that as your source. However this case would require quite a bit more effort to return the appropriate JSON structure as specified by the ArcGIS REST API. Going down this path is essentially mimicking the behaviour of ArcGIS Server and Hosted Feature Layers. Finally, depending on your use cases for a Feature Layer, it may be easier to start with a Graphics Layer to store your graphics. I would also suggest looking through the JavaScript API Samples, as there is a specific example, which is closely related to what you're trying to do: Create a FeatureLayer with client side graphics | ArcGIS API for JavaScript 4.4.
... View more
07-06-2017
06:58 PM
|
1
|
7
|
3985
|
POST
|
From the 4.4 release notes, bug fixes: BUG-000104500: It is now possible to uninstantiate the MapView's container and reinstantiate. Wondering if this could be related to your issue? Perhaps try out your code in a 4.4 version as a test.
... View more
07-05-2017
05:34 PM
|
0
|
1
|
945
|
BLOG
|
Can try this if you want: GitHub - kingy68/esri-javascript-draw-4: A freehand drawing tool for the Esri JavaScript 4.x API
... View more
07-02-2017
04:41 PM
|
0
|
0
|
3316
|
POST
|
Hey Domenico, It turns out it was most likely the browser and AGOL caching the original GET response, back when the SOI still wasn't working. Once I cleared the cache, it seemed to respond OK. Thanks for your help on this though! Cheers, Jordan
... View more
06-09-2017
12:05 AM
|
0
|
0
|
487
|
POST
|
Hey Domenico, AGS v 10.4.1 This is the default response to a layer Query: {"objectIdFieldName":"RECORD_ID","globalIdFieldName":"","geometryType":"esriGeometryPoint","spatialReference":{"wkid":102100,"latestWkid":3857},"hasZ":false,"features":[]} We're intercepting this result and building the output "features" array based on our own logic. Everything seems to look fine in the logs, it even is logging that it is overriding the output response. I've done some more digging around and it seems as if it is only happening when we have the following GET request: http://localhost:6080/arcgis/rest/services/testing/<serviceName>/FeatureServer/1/query?f=json&where=1%3D1&returnGeometry=true&spatialRel=esriSpatialRelIntersects&outFields=*&outSR=102100 If I change that request to include a single outField, or even remove the *, it all seems to work as expected. However, as previously mentioned, it seems strange, because the logs show that the code goes through the exact same process and even shows the intercepted result it is outputting. But it never appears to be output... Wondering if it could be a bug? Cheers, Jordan
... View more
06-05-2017
08:39 PM
|
0
|
4
|
487
|
POST
|
Hey Guys, We've built a SOI to intercept calls to a Feature Service, specifically the Query operation. What we've noticed just today is that the SOI seems to always send back a default response to a GET request, where as a POST will be intercepted and send back the 'edited' response. What's interesting is that the server still logs the full output as if it had been intercepted. So is there something specific we might need to do to ensure we are not sending back a default response to GET requests? We are only intercepting REST requests, not SOAP. Cheers, Jordan
... View more
06-04-2017
09:47 PM
|
0
|
6
|
1323
|
POST
|
Hey Domenico, Awesome find, thanks for the help! IMapServerInit2 mapServerInit = (IMapServerInit2)pSOH.ServerObject; mapServerInit.MaxRecordCount; Cheers, Jordan
... View more
05-30-2017
05:21 PM
|
0
|
0
|
413
|
POST
|
Hey All, I'm trying to get an instance of an IFeatureServerInfo within my Server Object Interceptor. I want to do this so that I can get the MaxRecorcdCount property on the Feature Service (http://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm#IFeatureServerInfo.htm ). Does anyone know of a way to use the IServerObjectHelper (or something else...) to create an instance of IFeatureServerInfo? Alternatively, does anyone know of another way to get the MaxRecordCount from the Feature Service within the SOI? Cheers, Jordan
... View more
05-29-2017
11:16 PM
|
0
|
3
|
975
|
POST
|
Hey All, Just wondering if anyone else has noticed this and if this is 'intended' behaviour.. I'm working with the 4.3 API and have noticed, if you add a MapImageLayer to your map, which has scale limits set on the sublayer (e.g. http://<yourarcgisserver>:6080/arcgis/rest/services/<yourMapServer>/0), these scale limits do not appear to populate as properties on the sublayer. By this I mean that the subLayer.minScale and subLayer.maxScale are there, but both are set to zero, even though they are not zero in the service. Although, the layer does still adhere to the set scale limits in the map. Here's an example of the properties I am talking about, these are on the only sublayer of my Map Service; I can override those values using subLayer.minScale = blah and it will set the property and enforce it. But I was expecting it to populate itself with the values from the Map Service, which could then be overridden programatically to new values if desired. As I mentioned above, even though they are set to zero, the min and max scale are still enforced in the map when zooming, but I'm guessing this is the Map Server sending back the images, not the dynamic layers. Also, as an FYI - we would like to use these values to set a zoom to layer button, when the layer is outside of the scale ranges. To achieve this in the 3x API's, we used to use the layerInfos property, which did set the min/max scale values from the Map Service. Cheers, Jordan
... View more
03-09-2017
08:00 PM
|
0
|
4
|
1906
|
POST
|
Hi All, FYI - there is already a BUG report for this issue: BUG-000102157: MapImageLayer does not rotate properly when used wit.. Cheers, Jordan
... View more
02-28-2017
04:14 PM
|
1
|
0
|
559
|
Title | Kudos | Posted |
---|---|---|
1 | 07-09-2017 05:58 PM | |
1 | 11-14-2016 10:19 PM | |
1 | 07-13-2016 10:57 PM | |
1 | 02-28-2017 04:14 PM | |
1 | 07-06-2017 06:58 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:25 AM
|