MAPIT(3NCARG)
π MAPIT β bestie edition π
ok so this is MAPIT, a lil routine from NCAR Graphics (that's the 3NCARG manual, mwah) and it literally just... draws lines on a map. that's the whole vibe. but it's SO much smarter than it looks, and i'm about to make you obsessed with it. πΊοΈβ¨
πΈ NAME πΈ
MAPIT β draws lines on a map. yes bestie, that's it, that's the job description, and it EATS. π
π SYNOPSIS π
CALL MAPIT (RLAT,RLON,IFST)
π¦ C-BINDING SYNOPSIS π¦
#include <ncarg/ncargC.h>
void c_mapit (float rlat, float rlon, int ifst)
β¨ DESCRIPTION β¨
okay so there's basically two inputs plus a mode switch, let's go:
RLATandRLONβ (input expressions, type REAL) these are the latitude and longitude of the point where the "pen" gets moved to. both in degrees, periodt.RLAThas to be between-90.and+90., inclusive (no cap, that's just math).RLONhas to be between-540.and+540., inclusive. yes,-540.to+540., that's a whole lotta longitude, and it's intentional. πIFSTβ (input expression, type INTEGER) this is the drama switch, and it has three moods:0β do a "pen-up" move. the pen is lifted, no line, we're just teleporting. π1β do a "pen-down" move, but ONLY if the distance from the last point to the new point is greater than'MV'plotter units. otherwise, nothing. it's giving "we only commit if it's far enough."2or greater β "pen-down" move, no questions asked, regardless of the distance from the last point to the new one. she's decisive. she commits. π
π C-BINDING DESCRIPTION π
the C-binding argument descriptions are literally the same as the FORTRAN argument descriptions. copy-paste energy, but make it official. π«Ά
π USAGE π
MAPIT draws lines on the map, and it's called by EZMAP itself and β if you want β by you, the user, the main character. β¨
MAPIT attempts to omit nonvisible portions of lines, and it also handles "crossover" β that's the jump from one end of the map to the other caused by the projection of the globe onto a flat surface. crossover can happen on cylindrical and conical projections; MAPIT handles it gracefully on the former and not so well on the latter. π (we love an honest queen.)
here's the recipe for drawing the projection of a line defined by a series of lat/lon coordinates:
- start by calling
MAPITwith the coordinates of the first point and withIFST = 0. - then call
MAPITrepeatedly with the coordinates of the next point along the line and withIFST = 1or2.
(IFST = 2 is normally used only for the final point, to ensure closure with a line drawn by another series of calls.)
- finally, if the next thing your program does is
stop, callFRAME, or change attributes like color or line width, you should callMAPIQto flushMAPIT's buffers. don't leave her hanging with unflushed buffers bestie, it's rude. π
the EZMAP parameter 'DL' determines whether MAPIT draws solid lines or dotted lines. dotted lines are drawn using calls to POINTS. solid lines are drawn using calls to DASHD, FRSTD, and VECTD. the parameters 'DD' and 'MV' also affect MAPIT's behavior. see the descriptions of these parameters in the ezmap_params man page. iykyk. π
keep in mind the following (the four commandments, fr fr):
- the projection of the line segment joining two points on the globe is considered to be the straight-line segment joining the projections of the points; no attempt is made to project it as if it were a portion of a great circle.
- if both endpoints of a line segment are visible, the segment is considered to be entirely visible.
- if both endpoints are invisible, the segment is considered to be entirely invisible.
- if one endpoint is visible and the other is not, a new point is interpolated at the boundary between the visible and invisible portions. only visible portions of the line are drawn.
because of these considerations, points defining a line should not be too far apart on the globe. like, keep your points close, they're a situationship, not long-distance. π
there are two types of boundaries between visible and invisible regions:
- the limb β a boundary between a projectable region and an unprojectable one. the limb may be circular, elliptical, or some other shape, depending on the projection being used. for example, an orthographic projection has as its limb a circle, centered at
(0,0), with a radius of1. π― - the perimeter β a rectangular or elliptical boundary defined by EZMAP parameters set by you to specify the region you wish to view. you're the one setting the vibe check here. π
π₯ EXAMPLES π₯
use the ncargex command to see the following relevant examples: cmpgci, cmptra, mpexfi. go look, they're iconic. π
π ACCESS π
to use MAPIT or c_mapit, load the NCAR Graphics libraries ncarg, ncarg_gks, and ncarg_c, preferably in that order. order matters bestie, trust. π
π SEE ALSO π
online: ezmap, ezmap_params, mapaci, mapbla, mapblm, mapdrw, mapeod, mapfst, mapgci, mapgrd, mapgrm, mapgtc, mapgti, mapgtl, mapgtr, mapint, mapiq, mapiqa, mapiqd, mapiqm, mapita, mapitd, mapitm, maplbl, maplmb, maplot, mappos, maproj, maprs, maprst, mapsav, mapset, mapstc, mapsti, mapstl, mapstr, maptra, maptri, maptrn, mapusr, mapvec, mpchln, mpfnme, mpgetc, mpgeti, mpgetl, mpgetr, mpglty, mpiaty, mpifnb, mpilnb, mpiola, mpiosa, mpipai, mpipan, mpipar, mpisci, mplnam, mplndm, mplndr, mplnri, mpname, mprset, mpsetc, mpseti, mpsetl, mpsetr, supmap, supcon, ncarg_cbind
hardcopy: NCAR Graphics Contouring and Mapping Tutorial π
π COPYRIGHT π
Copyright (C) 1987-2009 University Corporation for Atmospheric Research The use of this Software is governed by a License Agreement.
and that's the whole page bestie!! this came from the UNIX edition of the MAPIT(3NCARG) manual page, dated March 1993 β yes, she's vintage, she's a classic, she's timeless. πβ¨π now go draw some lines and slay. π¦ππ
π¦ where this page comes from
- debian bookworm: libncarg-dev 6.6.2.dfsg.1-1
- debian trixie: libncarg-dev 6.6.2.dfsg.1-10+b2
- ubuntu jammy: libncarg-dev 6.6.2-10build2
- ubuntu questing: libncarg-dev 6.6.2.dfsg.1-10build2
- ubuntu resolute: libncarg-dev 6.6.2.dfsg.1-12
- ubuntu stonking: libncarg-dev 6.6.2.dfsg.1-12build2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms