How do I project my data?The following projections are available within Gsharp:
Other projections can be implemented in GSL There are many functions for controlling the built-in projections and they are described in the GSL function reference section. The main three routines are:
As you can see from the example below the only other step you must consider is setting the X Ratio and the Y Ratio of the viewport so that 1 unit of X equals 1 unit of Y. The simplest way to get this correct is to set xRatio equal to the range of the X axis and yRatio equal to the range of the Y axis. Once you have set up the projection using proj_type and proj_origin, you must then call proj_transform everything that you want to add to your plot - the data, a worldmap, a grid. #Exampleimport_worldmap("", "full", "CoastLong", "CoastLat", -90,-60,15,40);
BermudaLong = -65 // -81.6// -66.2// -65;
BermudaLat = 32.33// 30.5// 18.5// 32.33;
proj_type("utm");
proj_origin(12,55);
proj_transform(CoastLong, CoastLat, "CoastLongP", "CoastLatP"); proj_transform(BermudaLong, BermudaLat, "BermudaLongP", "BermudaLatP"); |