Get attribute information from feature

669
2
Jump to solution
09-10-2024 06:25 AM
WH1981
by
Regular Contributor

Hello,

I hope someone can help me with this.

I'm a beginner, but I managed to retrieve the object ID using a raycast from an ArcGIS3DObjectSceneLayer. See script below.

But is it possible to use this featureid/objectid attribute to request information about the feature and display it in a .text? For example the Name.

 

RaycastHit hit;

if (Physics.Raycast(ray, out hit))
{
var arcGISRaycastHit = arcGISMapComponent.GetArcGISRaycastHit(hit);
var layer = arcGISRaycastHit.layer;
var featureId = arcGISRaycastHit.featureId;

if (layer != null && featureId != -1)
{
featureText.text = featureId.ToString();

}
}
}
}

 

 

 

0 Kudos
1 Solution

Accepted Solutions
WH1981
by
Regular Contributor

Thanks for your answer..

It works now using a UnityWebRequest on the FeatureLayer with the FeatureID.

View solution in original post

0 Kudos
2 Replies
MasonGaw
Regular Contributor

Hello, 

From my understanding it is possible but you would need your 3DObjectSceneLayer (or whatever layer type you are using) to also have a feature layer accompanying it. You would then need to query the feature layer similar to how the Feature Layer Sample or Weather Query Sample work in order to access more information. 

This is something we plan to work on in the future as a public sample but unfortunately have not had enough time.

Please let me know if you have any other questions.

Mason 

0 Kudos
WH1981
by
Regular Contributor

Thanks for your answer..

It works now using a UnityWebRequest on the FeatureLayer with the FeatureID.

0 Kudos