What is the proper way to check if a SpatialReference is WGS84?
I have tried
Dim sr as SpatialReference = MapView.Active.Camera.SpatialReference
If sr = SpatialReferences.WGS84 Then IsWGS4=True 'doesnt work
If sr Is SpatialReferences.WGS84 Then IsWGS4=True 'doesnt work
If If sr.Name = "GCS_WGS_1984" Then IsWGS4=True 'this works
Solved! Go to Solution.
The easiest way is to check the well-known id.
if (sr.Wkid == SpatialReferences.WGS84.Wkid)
IsWGS84 = true;
or you could use the hard-coded wkid = 4326.
if (sr.Wkid == 4326) ... but occasionally these wkids are changed by EPSG so the first way is safer.
The easiest way is to check the well-known id.
if (sr.Wkid == SpatialReferences.WGS84.Wkid)
IsWGS84 = true;
or you could use the hard-coded wkid = 4326.
if (sr.Wkid == 4326) ... but occasionally these wkids are changed by EPSG so the first way is safer.
Thanks for the tip.