[Xastir] a choice of formats

Tom Russo russo at bogodyn.org
Sat Feb 9 19:43:30 EST 2013


On Sun, Feb 10, 2013 at 10:16:59AM +1100, we recorded a bogon-computron collision of the <edodd at billiau.net> flavor, containing:
> On Sat, 9 Feb 2013 15:40:51 -0700
> Tom Russo <russo at bogodyn.org> wrote:
> 
> > You will always need to create a dbfawk file for shapefiles that
> > aren't one of the standard set for which we provide dbfawk
> > templates.  This is the only way to tell Xastir how to do more than
> > draw black lines and crosses for polyline and point shapefiles.
> > 
> > There is a tutorial for how to do that on the Xastir wiki.
> 
> 
> Is this still true??
> ==================
> Where do I find out what number corresponds to what color?
> 
> Sadly, Xastir's color handling is rather old-school, and you can't just
> specify a color by giving its RGB values. That's because Xastir still
> has code designed to work on ancient 8-bit X displays that used a
> pseudocolor table. Xastir allocates a number of specific colors from
> the X server when it starts up, and these colors are accessed from an
> array by their index into that array. Xastir allocates the colors using
> the names that are defined in the "rgb.txt" file associated with your X
> server. If you really want to know what the RGB values of these colors
> are, find the color name in that file. 
> =======================

Why would it not still be true?  Xastir has not yet undergone any major 
refactor of any kind.  That is to say, yes, it's still true.

There is a table of color "indices" and a rough description of their color
in the tutorial.  It may not be definititive, but it is darned close.  The
definitive source for mapping of color indices to color names is in 
main.c, and the mapping of color names to RGB values is in the "rgb.txt" file
that lives where your X configuration files live (on my system that's
/usr/local/lib/X11/rgb.txt, but your mileage may vary).

If you look at a dbfawk file for the "tiger" polylines files you can see
which colors we chose for rendering those files.  The "tgr2shp.dbfawk" is
pretty well documented with what sort of features each line of the 
file is dealing with, and you can try to copy that color scheme for a first
cut, and then fine tune from there.

-- 
Tom Russo    KM5VY   SAR502   DM64ux          http://www.swcp.com/~russo/
Tijeras, NM  QRPL#1592 K2#398  SOC#236        http://kevan.org/brain.cgi?DDTNM
 echo "prpv_a'rfg_cnf_har_cvcr" | sed -e 's/_/ /g' | tr [a-m][n-z] [n-z][a-m]

 





More information about the Xastir mailing list