XMPDRAW x0.40 - README last revised Mon Feb 24 00:49:29 EST 1992 This is a quickie release of a map projection learning effort I have been making. This posting to alt.sources replaces a failed posting of 2/22/92. If you build it successfully, you'll see a good bit of the Northern Hemisphere on an X window. You can zoom around and generally waste time. I'll be fixing this up better later if there is any interest, but for now be motivated enough for me not to have to stop a crash project to write a lot of confusing stuff. You'll need X11R4 and Xaw and a 800x600x4 color display or better. There's a hack for smaller displays, but it won't be very nice. Color is required. ---------------------------------------------------------------------------- Steps: 1. xmkmf (This works fine for me with SCO+MIT/Roell_R4 and SunOS 4.1.1+ MIT R4; I took a stab at BSD compatibility: see Imakefile) 2. make (This should make xmpdraw, amd2amb and _us.amb 3. doit (This cranks up xmpdraw and tries to do it) 4. play with the keys, (widget) buttons and (mouse) Button 1 dragging ---------------------------------------------------------------------------- Note: If you are on SCO UNIX using gcc and don't have these defines in your at386.cf, you are asking for it (the SCO MSC cc does provide them and the SCO header files expect most of them in various places to decide upon which target you are compiling for): -DM_BITFIELDS -DM_COFF -DM_I386 -DM_I86 -DM_I86SM -DM_INTERNAT -DM_SDATA\ -DM_STEXT -DM_SYS3 -DM_SYS5 -DM_SYSIII -DM_SYSV -DM_UNIX -DM_WORDSWAP -DM_XENIX -Dunix -Di386 Most gccs for 386 systems already define i386 but not all of them. It depends on how you set it up. Since I write a fair amount of software for public use, I tend to avoid customization of things like gcc configuration. ---------------------------------------------------------------------------- Quick explanation: Button 1 is used to form a bounding box for zooming. Place the mouse, press button 1 and drag. Let up on button 1 and press the 'r' key. Buttons 2 and 3 display longitude and latitude information for a point on the map. If cities are displayed and the selected point is within 4 pixels of a city, the name is also shown. A colored cross is placed on the screen. If a city match is found, the cross is placed directly on the city rather than immediastely beneath the cursor. [Constrain] defaults to on: If on, the Button 1 bounding box is constrained to be within the aspect ratio of the curRent display window If off, a bounding box of any aspect can be formed. [AMB Files] selects which files you want to include in a refresh cycle. There's only two for now, _us.amb and cities.amb. They show up as "us" and "cities". The "us" will be turned on automatically as described below. Keys with the mouse in the drawing box: (some keys merely update the projection data and mark the display with "need refresh") + zoom in by 5% - zoom out by 5% nsew north, south, east or west by 5% c crop display to bounding box area (zoom) l Lambert Conformal projection m Mercator pseudo-projection r refresh (actually update the display, cropping if box active even if 'c' was not pressed) i initialize (start over with original display) q quit There are no published resources other than Test.geometry: +0+0 will keep you from having to click button 1 to place the window and startup on some installations. ---------------------------------------------------------------------------- Map data source: The map data is derived from ASCII "amd" files and converted to machine-dependent binary "amb" files for actual use. amd2amb does this. When running xmpdraw (which doit does), by xmpdraw ... any with a leading underscore is automatically included for display. The included data _us.amd is borrowed from the wxmap distribution with thanks. Cities data file cities.amt is derived from from usamap.exe by Donald Harms Our actual data is coming from the USGS CD-ROM distribution (1-800-BUY-MAPS) and the CIA World Data Bank II, but those are rather largish for usenet distribution :-). ---------------------------------------------------------------------------- Editorial: No apologies here: The code this sits in in a "lab" for playing with X I have been hacking on and hanging new bags on for a while. It started out as an oscilloscope and has been hacked over several times since. The X11 crocks work to speed up quick hackery on the central problem. The baggage doesn't show up in anything real. On the other hand, when it comes to the actual science at hand, I am still hooked to an umbilical cord. Thanks for code fragments and ideas from: Russell A. Ambroziak, Ph.D. Office of Energy and Marine Science U.S. Geologic Survey National Center, Stop 915 Reston, VA. John.L.Ryan Mark Bolstad wxmap code by Charley Kline, University of Illinois Computing Services Office. olvwm for rubber banding MIT X11R4 server code for line clipping ---------------------------------------------------------------------------- What I would like from you (if you have the time): 1a. Real mathemagicians please comment on the map projection stuff in mp.c. I am trying to come up with a legitimate way to take a given rectangle of top left and bottom right lat/lon pairs run it through the projection method requiring a center lat/lon and km/pixel while living within the current size and aspect ratio of the current window. setproj_by_bounds(mp,mbr) is a hideously hilarious brute force attempt to do this. 1b. I also am looking for filtering techniques to reduce data accuracy when detail to 88 feet isn't needed :-) Please remember my background is data communications and any data types other than an unsigned char, short and long is -heh-heh- yuppie extravagance :->. Other than a 30 year love for trigonometry and analytic geometry, I'm pretty dumb in these spaces. 2. Does anybody have any pointers on how to organize vector sets to quickly isolate the vectors appropriate to visit given a specific zoom bounds? 3. Scroungers: I need map data sources: geographic coordinates for more cities, political boundaries for non-US provinces and the like. ---------------------------------------------------------------------------- E-mail reduction effort: I don't know where the CIA data can be obtained. I got it third hand and you don't want my copy. The USGS has a wonderful $29 CD-ROM with 561 Megabytes of data, ranging from useless/difficult to exceptionally valuable. It is a bit out of date, but if you take proposed highways as being real ones, you'll get a pretty good picture. They are at: Earth Science Information Center U.S. Geological Survey 507 National Center Reston, Va 22092 (703) 648-6045 (800) USA-MAPS ---------------------------------------------------------------------------- Warren Tucker, Mountain Park Cartography n4hgf!wht/wht@n4hgf.Mt-Park.GA.US A remote debugging human who appreciates Howard Rourke, Leonard Cohen and PI