Querying Scene Layer

386
16
Jump to solution
09-16-2021 05:47 PM
sullivani
New Contributor III

Hi, I am attempting to query a scene layer using the latest Javascript API, but am getting the 'query-not-available' error.

I can confirm that I have a associated feature layer, although uploading the scene layer from ArcGIS Pro did not give me the option to associate the feature layer, even though I can see it uploaded the feature layer.

I have a feeling that the issue relates to the fact that I have an ArcGIS Online account, not a ArcGIS Enterprise account - can someone please confirm this.

It would be disappointing if that was the reason why I cannot query a scene layer.

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
IhabHassan
Esri Contributor

Hi @sullivani 

I found an ESRI JS sample that is doing something very similar to what you are doing, and I can see it is giving the same error message, even before doing any query/identify operation.

https://developers.arcgis.com/javascript/latest/sample-code/layers-scenelayerview-query/live/

My guess now is that there is something wrong either with the JS APIs latest release or something wrong with the published data.
However, by debugging the code, I can see that the "buffer-too-small" error is not stopping the application, and I am still able to do the identify and see the result in the browser console.

Regards

Ihab

Regards
Ihab

View solution in original post

16 Replies
sullivani
New Contributor III

Ok, so I have reuploaded the data to ArcGIS Online and retried the query, but it seems I have hit another issue, one which I have not been able to find any info on.

The following error is occurring when I either attempt to apply a query or a definition expression to the Scene layer. Weirdly, I can identify the features within a Scene layer i.e. if I click on the map, I get a popup showing the feature attributes.

Logger.js:5 [esri.views.3d.layers.i3s.I3SBinaryReader] Invalid attribute buffer size expected: 7676922352, actual: 25)

 

Does anyone know what could be causing these errors?

0 Kudos
IhabHassan
Esri Contributor

Hi @sullivani 

There is SceneView and there is a FeatureLayer:

SceneView: provides the 3D display for the added feature layers

FeatureLayer: endpoint to a map service that may allow querying underlying data source

So, you may need to check first if the FeatureLayer has query endpoint available, check if you can browse to similar URL to this "{arcgis server url}/server/rest/services/Hosted/HV_ONE/FeatureServer/0/query"

This might be one thing that can clear things up.

 

Regards

Ihab

Regards
Ihab
0 Kudos
sullivani
New Contributor III

Hi @IhabHassan, I can confirm that there is a corresponding feature service and it is queryable. It seems the first issue I mentioned may have been resolved, but now the second issue is occurring, which I can't find any info on.

0 Kudos
IhabHassan
Esri Contributor

can you paste here the function/logic that you are trying to run which gives this error?

Regards
Ihab
0 Kudos
sullivani
New Contributor III

Its a simple query:

const query = sceneLayer.createQuery();
query.geometry = pointGeometry;
query.spatialRelationship = 'intersects';
query.returnGeometry = false;
sceneLayer.queryFeatures(query).then(featureSet => {
    // Do something here
});
0 Kudos
sullivani
New Contributor III

Actually it looks like I am getting the same error no matter if its a query, identify or definitionExpression.

So there is something clearly wrong with the service....but I have no idea what that could be as the scene layer and associated feature layer were uploaded via ArcGIS Pro as per the screenshot.

sullivani_0-1632097169170.png

 

0 Kudos
sullivani
New Contributor III

The issue may be related to the fact that there appears to be no attributes associated with the scene layer.

In addition to the previous error, I am also getting the following errors:

sullivani_0-1632106672315.png

 

When I upload the layers to ArcGIS Online, I have checked that the upload includes associated attributes as per the screenshot:

 

sullivani_3-1632106869390.png

 

 

 

0 Kudos
IhabHassan
Esri Contributor

Hi @sullivani 

I found an ESRI JS sample that is doing something very similar to what you are doing, and I can see it is giving the same error message, even before doing any query/identify operation.

https://developers.arcgis.com/javascript/latest/sample-code/layers-scenelayerview-query/live/

My guess now is that there is something wrong either with the JS APIs latest release or something wrong with the published data.
However, by debugging the code, I can see that the "buffer-too-small" error is not stopping the application, and I am still able to do the identify and see the result in the browser console.

Regards

Ihab

Regards
Ihab

View solution in original post

sullivani
New Contributor III

That is the exact error I am getting, but unfortunately it does seem to stop the queries and definition expressions from working correctly.

I just had a look at the scene layer metadata and I cant see any info on the fields as per the screenshot. Is this normal, or should it show info on the associated fields?

sullivani_0-1632110106354.png

 

0 Kudos