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.

How do I get the units (meter/feet) from an ISpatialReference object in ArcObjects?

share|improve this question

1 Answer 1

up vote 7 down vote accepted

Linear units can be obtained from the spatial reference only if it is a projected coordinate system. So, you need to cast the spatial reference to IProjectedCoordinateSystem and access its IProjectedCoordinateSystem.CoordinateUnit property.

But if the spatial reference is a geographic coordinate system, its units are angular and accessed similarly through IGeographicCoordinateSystem.CoordinateUnit.

share|improve this answer
    
+1 The ILinearUnit.MetersPerUnit property can also save you from writing a lot of code. –  Kirk Kuykendall Apr 25 '11 at 13:52
    
Thanks guys! Problem solved. –  user2449 Apr 26 '11 at 15:30

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.