0

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);
MvG
  • 57,380
  • 22
  • 148
  • 276
Zlex
  • 147
  • 2
  • 11
  • Where on earth did this formula come from? – John Powell Sep 01 '14 at 13:43
  • What is your definition of a square on a curved surface? Same number of degrees of latitude as of longitude? What programming language is this, and what libraries? Do you really mean WGS64, or rather [WGS84](http://en.wikipedia.org/wiki/World_Geodetic_System)? – MvG Sep 02 '14 at 07:14

0 Answers0