Select to view content in your preferred language

Populate featureTable with centroid only geometry from feature service

58
1
yesterday
ForrestKaye
Regular Contributor

Hello,

    I was wondering if it is possible to populate a FeatureTable from a Feature Service with the centroid only geometry.  Looking through the documentation and attempting this does not make it seem possible with the maps SDK.  I could do it by pinging the FeatureService directly and using the returnCentroid parameter but that does not seem to be exposed in the SDK.

    If this is not possible can I put an enhancement request in for it?  Use case is this: Querying polygon features hosted in a service. I do not want to return the entire geometry for performance reasons. I want to sort the features by nearest location to the user.  Having access to the centroid would satisfy my sorting and performance needs.  

 

 

0 Kudos
1 Reply
Ting
by Esri Regular Contributor
Esri Regular Contributor

Hi Forrest, thanks for posting. You are right, currently our SDK doesn't support the returnCentroid parameter.

Some (SDK-client-side) alternatives that may be worth a try: GeometryEngine.labelPoint(for:), or Envelope.center, for a rough estimate if the polygon is simple.

As they may not be suitable for your use case, please feel free to post in Native SDKs Ideas with your use case.

0 Kudos