AnsweredAssumed Answered

How to get Polygon Centroid / LabelPoint property

Question asked by vasileebp on May 22, 2018
Latest reply on May 23, 2018 by bixb0012

Check the following Python code

from arcgis.features import FeatureLayer

from arcgis.geometry import Geometry

 

url = 'https://services.arcgis.com/V6ZHFr6zdgNZuVG0/ArcGIS/rest/services/NYCDemographics1/FeatureServer/0'
layer = FeatureLayer(url)

query = layer.query(
   where = '1=1',
   out_sr = 4326,
   geometry_precision = 6,
   result_record_count = 10,
)
geom = Geometry(query.features[0].geometry)

 

print (geom.centroid)
print (geom.extent)

 

I am trying to compute the 'label_point' property of a Polygon object in Python API (1.4)

arcgis.geometry module — arcgis 1.4.1 documentation 

 

But I get 'None'. Same goes for 'centroid' or other properties, shall I use another constructor for Geometry?

Outcomes