Proper way to check if a Factory Code is Projected or Geographic

المشرف العام

Administrator
طاقم الإدارة
I would like to create a SpatialReference with ArcObjects, but I won't know whether it is Projected or Geographic, I'll only have the SRID. Is it fine practice to use 'ISpatialReferenceFactory.CreateGeographicCoordinateSystem' with a 'try', see if it fails, and if so, use 'CreateProjectedCoordinateSystem', and if that fails, give a message that it won't work? I have a feeling that I shouldn't use Exceptions in this way, but I'm not aware of an alternative.

I am aware of these answers, but they don't quite answer the question:

Arcobjects: Is my spatial reference Geographic or Projected?

How to programmatically determine whether a spatial reference factory code is valid?



أكثر...
 
أعلى