I working in wgs64 gis.
I have the coordinates of polygon given by decimal degrees.
I trying to expand the polygon envelop from a rectangle to a square. I understand that a rectangle of one degree of latitude and longitude on the sphere has not the same length in km unless it is situated on the equator. But I don't understand the math behind how to fix my envelop.
I am doing this:
Envelope contextEnvelope = CurrElement.Envelope;
double Max = Math.Max(contextEnvelope.Width, contextEnvelope.Height);
contextEnvelope.Expand((Max * 15 - contextEnvelope.Width) / 2, (Max * 15 - contextEnvelope.Height) / 2);