Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I've got some SimpleFeatureCollections and now I want to get the Centroid of every SimpleFeature in the collection. Unfortunally I've only found a centroid method for Geometry.

Is there any way to get the centroid?

share|improve this question
1  
Geometry geom = (Geometry) feature.getAttribute("the_geom"); System.out.println(geom.getCentroid()); this works for me –  ABLX Feb 19 '12 at 2:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.