Error: Run-time error '5031': Invalid coordinate system for this data.
When attempting to apply the ProjCoordSys or GeoCoordSys object to the CoordinateSystem property of a MapLayer or a Map control, this error may occur:
Run-time error '5031': Invalid coordinate system for this data.
One or more properties or parameters for a GeoCoordSys or ProjCoordSys object are improperly set. MapObjects is unable to mathematically process the feature's coordinates to perform the desired projection.
Solution or Workaround
When setting the properties of the eight Projection objects individually, as opposed to using the Type property, be careful to specify settings that are appropriate for the data.
For example, avoid defining the Unit for a Projection object as degrees if the Projection's dataset is in meters. The range of coordinate values (in meters) is likely to exceed the valid range for degrees (+/-180,+/-90), which will yield the error.
Most Projections have a number of parameters, such as Central Meridian, Central Parallel, etc. If left unspecified, some parameter values will default to zero. This may result in an invalid projection, for example, when both the 1st and 2nd standard parallels are allowed to default to zero. Be sure to set parameter values that make sense for the data.