Polar Projections and Geographic Selection in the IMS

Introduction

The origin of the weirdness surrounding polar projections in the IMS lies in turnover. Many programmers, with varying degrees of expertise in the area of maps and map projections, have had a hand in this, often working against each other. As one example I offer this bit of code lifted from IX_Coords1.c.

void activateCB_WorldPB (Widget wgt, XtPointer client, XtPointer call)
{
  if (projection==MERCATOR) return;
  projection=MERCATOR;
  map_proj_type=PLATE_CARREE;
  center_lat=0;
  XtVaSetValues(scroll_lat,XmNvalue,center_lat,NULL);
  calcMap(window_width, window_height, zoom_val);
  drawMap();
  redrawBox();
}

Here we see that in response to some button being pressed (the "World" pushbutton) two global variables are being set. One is simply "projection" and the other is called "map_proj_type". Both are used in various subroutines as switches. As you can see projection is set to "MERCATOR"and map_proj_type is set to "PLATE_CARREE". These two are mutually excusive - and, as it happens, the former is wrong.

As another example I'll merely mention that the subroutine that does the (x,y) to (lat,lon) conversion for the Plate-Carree map is called "mercate".

Clearly at some point someone with little knowledge of map projections worked on the geographic selection screen. At some other point someone with a little better understanding of what was going on also worked in this area. And its likely about 47 other people with varying degrees of expertise also contributed.

The four main points I'd like to make are these:

  • Rectangles are polygons.
  • Polygons have straight edges.
  • "Clockwise" is a matter of POV.
  • The pole is NEVER included.