[Xastir] pos file

Tom Russo russo at bogodyn.org
Fri May 22 13:03:09 EDT 2009


On Fri, May 22, 2009 at 09:53:21AM -0700, we recorded a bogon-computron collision of the <archer at eskimo.com> flavor, containing:
> On Fri, 22 May 2009, Tom Russo wrote:
> 
> > The format of a GNIS file (new format) is fairly straightforward.  You need
> > either the very latest snapshot that Curt put together yesterday, or a
> > CVS version more recent than April 13th or thereabouts.
> 
> Hey Tom, how about using one of your scripts to do this so both of
> us don't reinvent the wheel here?  hi
> 
>      xastir/scripts/object2shp.pl

Heh.  I forgot about that wheel!

It could be trivially modified to do pos format instead just by
changing the parsing lines between lines 81 and 89, I think.  Those
lines look for the semicolon at the beginning of the line, the "live_or_dead" 
flag, and the timestamp.  None of those are present in the pos format.  And
it assumes the name is 9 characters, which is not the case, so one would
have to  replace that by a search forward for the bang ("!") to get the
name delimiter.  All the assumptions about where things live on the line are
broken for pos format, but once one rewrote that block to fill in the right
variables from the alternate format, the rest of the dbfadd/shpadd stuff 
will all work.

> Thought process:
> 
> 1) Bring the POS items in as objects by modifying the file slightly
> as was already reported to work here.
> 
> 2) Take the object.log file and run it through object2shp.pl.
> 
> 3) Put the new map (maps?) into your map directory, reindex, and use
> the new map as an overlay.
> 
> We could automate step #1 with YAPS (yet another Perl script) later
> perhaps, but this should get overlay maps going for the weekend,
> right?

Yes, one could do that easily with no new scripting, especially since Keith
already knows how to pull the pos files into the object log.

He would have to have shpcreate/dbfcreate/shpadd/dbfadd installed for 
object2shp.pl to work.  I don't know how common that is.  They're built as 
part of a source build of shapelib, but I have no idea if the binary packagers 
ever install them.  They're trivial to build, and one of these days I'll buy 
some round tuits and make our internal shapelib set-up build them if 
requested.  One of these days.

-- 
Tom Russo    KM5VY   SAR502   DM64ux          http://www.swcp.com/~russo/
Tijeras, NM  QRPL#1592 K2#398  SOC#236        http://kevan.org/brain.cgi?DDTNM
  In some cultures what I do would be considered normal. 
                                  -- Ineffective daily affirmation 



More information about the Xastir mailing list