[Xastir] Can I ???

Tom Russo russo at bogoflux.losalamos.nm.us
Wed Apr 28 21:05:30 EDT 2004


On Wed, Apr 28, 2004 at 09:36:02AM -0700, a Mr. Richard Feyler of Fort Lee, New Jersey <archer at eskimo.com> writes 'Dear Rosanne Rosannadanna':
> There are a couple of ways that I can think of:
> 
> 1) Create fake APRS Object or Item packets out of them, store them
> in a file, then suck that file into Xastir using the "Open Log File"
> option.  That will make them appear on your map.  If you use your
> own callsign for them, Xastir should transmit out their locations as
> well, as if you had created them manually via the mouse.
> 
> 2) Create your own GNIS-format map file (really just a bunch of
> text), and then enable that map.  This method would allow you to
> enable/disable various layers/groupings of the above individually,
> and you wouldn't end up transmitting the locations.  Some of the
> above objects show up as icons on the maps, some just as text with a
> little red 'x'.  If you need more of these to show up as icons, we
> could discuss adding that capability to Xastir.

3) create your own shapefile for it, per the README.MAPS file.

You will need all the shpcreate/shpadd programs that can be built in shapelib.

I did this for several lists of points of interest.  The original lists
were just semicolon delimited data lines like: "lat long; name" 
I augmented that to be "lat lon; symbol; name" and used the tiger landmark 
dbfawk file with it.  Alan Crosswell had already 
set it up so that if "symbol" can be a full APRS symbol with table, symbol and 
overlay if the "CFCC" field is "X" followed by the TSO (e.g. "X\m " for a 
trailhead symbol, "X\m " for a signpost, etc.

In fact, I wrote a tiny perl script to take a file of lines of the form
  lat lon; symbol; name
and convert it to a shapefile that would be displayable with xastir and the
dbfawk file for tiger landmark points.  Here it is.  Comment out the "cs2cs"
stuff if your shapefile is already in NAD83 or WGS84 lat/lon.

Following that is a tiny  example of the data I used with this script.

HTH,
T.

------
#!/usr/bin/perl
if ($#ARGV != 1)
{
    print STDERR "Usage: $0 datafilename shapefilebasename";
    exit 1;
}

open(INFILE,$ARGV[0]);
$dbfcrtcmd="dbfcreate $ARGV[1] -n ID 8 0 -s CFCC 3 -s NAME 30";
$shpcrtcmd="shpcreate $ARGV[1] point";
print $shpcrtcmd."\n";
print $dbfcrtcmd."\n";
#system($shpcrtcmd) || die("Shape create command failed\n");
#system($dbfcrtcmd) || die("dbf create command failed\n");
$i=0; 
while (<INFILE>)
{
    @splitline=split(/; +/);
    @latlon=split(/ /,$splitline[0]);
    $sym=$splitline[1];
    chomp($splitline[2]);
    $name=$splitline[2];

    $names[$i]=$name;
    $syms[$i]=$sym;
    $lat[$i]=$latlon[0];
    $long[$i]=$latlon[1];

    $i++;
}
close(INFILE);
# Now convert to NAD83 correctly (as opposed to the bogus way that shpproj 
# does it)

$cs2cscmd="cs2cs +proj=latlong +datum=NAD27 +to +proj=latlong +datum=NAD83 -f \"%.8f\"< inpt$$ > output$$";

open (CVTOUT,">inpt$$");

for ($i=0;$i<=$#lat;$i++)
{
    print CVTOUT "$long[$i] $lat[$i]\n";
}
close(CVTOUT);
system ($cs2cscmd)==0 || die "cs2cs cmd failed\n";

open (CVTIN,"output$$");
$i=0;
$#long=-1;
$#lat=-1;
while (<CVTIN>)
{
    @splitline=split;
    $long[$i]=$splitline[0];
    $lat[$i]=$splitline[1];
    $j=$i+1;
    $shpaddcmd="shpadd $ARGV[1] $long[$i] $lat[$i]";
    $dbfaddcmd="dbfadd $ARGV[1] $j '$syms[$i]' \"$names[$i]"."\"";
    $i++;

    print $shpaddcmd."\n";
    print $dbfaddcmd."\n";
}
--------
Example input:
--------------
35.193879 -106.404103; X\[ ; Tree Spring TH 
35.191080 -106.406538; X\m ; Junc. Tree Spring & Oso Cor. 
35.180903 -106.387395; X\m ; Junc. Oso Cor, Faulty & Bill Spr. 
35.195739 -106.425227; X\m ; Junc. Ski Run & 10K 
35.187003 -106.420248; X\m ; Junc. Tree Spr. & 10K 
35.230885 -106.479345; X\m ; Junc. Piedra Lisa &|Juan Tabo Canyon 
35.162641 -106.469672; X\[ ; Elena Gallegos TH 
35.170945 -106.465746; X/& ; Gate to Wilderness 
35.176511 -106.466252; X\m ; Sign Post - Cross Canyon Here 
35.177502 -106.465142; X\m ; Sign Post 
35.178684 -106.463282; X\m ; Sign Post 
35.180333 -106.461134; X/- ; Stone House 
35.181113 -106.459182; X\m ; Bear R. to TWA just past big ponderosa 
35.233736 -106.450608; X\m ; Cutoff to Shield from N. Crest Tr. 
35.237503 -106.448168; X\m ; S. Junc. N. Crest & 10K Tr.  Has Sign 
35.200531 -106.428906; X\m ; Junc. Ski Run &|10K Trail N. Side 
35.124283 -106.397946; X\m ; Junc. Forest Park & Faulty TR 
35.111987 -106.397456; X\m ; Junc. Upper &|Lower Faulty 
35.097538 -106.396289; X\m ; Junc. N. Crest &|Faulty Tr. Has Sign 
35.098722 -106.479477; X\[ ; Embudo Trailhead 
35.098403 -106.468264; X\m ; Horse Trail Cutoff 
---------------------------------------

-- 
Tom Russo    KM5VY     SAR502  DM64ux         http://www.swcp.com/~russo/
Tijeras, NM  QRPL#1592 K2#398  SOC#236 AHTB#1 http://www.qsl.net/~km5vy/
 "It is inhumane in my opinion to force people who have a genuine
  medical need for coffee to wait in line behind people who apparently
  view it as some kind of recreational activity."  -- Dave Barry



More information about the Xastir mailing list