[Xastir] dbfawk and tiled shape files

Alex Carver kf4lvz at yahoo.com
Thu Apr 26 17:50:19 EDT 2007


--- Tom Russo <russo at bogodyn.org> wrote:

> On Thu, Apr 26, 2007 at 12:39:34PM -0700, we
> recorded a bogon-computron collision of the
> <archer at eskimo.com> flavor, containing:
> > On Thu, 26 Apr 2007, Mike Fenske wrote:
> > 
> > >  You can get by with one dbfawk file if the dbf
> fields are the
> > >  same for each shapefile and you want each
> shapefile displayed the
> > >  same. Sounds like this is what you want. I have
> done just that
> > >  here with a large shapefile I split up. Put the
> dbfawk file in
> > >  the /usr/local/share/xastir/config directory.
> The name of the
> > >  file doesn't really matter. Name it something
> so you can remember
> > >  what shapefile set it's for. The important
> thing is that the
> > >  "dbffields" list matches the dbf fields of the
> shapefile set.
> > >
> > > I'm not sure, but I think you have to either
> restart Xastir or
> > > maybe "re-index all maps" to get it to recognize
> the new dbfawk
> > > file. Tom or Curt will know for sure :)
> > 
> > As I recall, the rules are:
> > 
> > *) If it is in the directory listed above, you
> have to restart
> >    Xastir to reload that file.
> > 
> > *) If it's a per-map dbfawk that's located with
> the map file itself,
> >    loading the map reloads the dbfawk.
> 
> Close.  It's actually like this:
> 
>  1) First we look for a per-map file that has the
> same base name as the map,
>     and a ".dbfawk" suffix.  If found, it's used.
> 
>  2) If no per-map file is found, a per-signature
> file is searched for in
>     the config directory.
> 
> 
> The the signature-based files are parsed on first
> map draw and saved, and once 
> upon a time it required a restart of xastir to
> re-parse them.  I changed that 
> quite some time ago -- now the dbfawk signatures are
> purged upon re-indexing
> maps, either by selecting "Reindex ALL maps" or "add
> new maps".  It is not
> necessary to restart anymore, and it isn't necessary
> to reindex all maps either.
> "Add New Maps" will force a reload even if there are
> no new maps.  I set that
> up deliberately so that when folks are working on
> per-signature dbfawk files
> they don't have to sit through entire program
> restarts or full map reindexes
> to check their slightly modified dbfawk files.
> 
> NOW... there's another issue.  The original poster
> was clearly trying to 
> tinker with dbfawk files pertaining to weather alert
> counties; he's cut them
> up into smaller tiles and wants to tinker with the
> rendering.  For the 
> wx county shapefiles, there's already a
> per-signature dbfawk file in the config
> directory, so one does NOT have the option of
> creating a second, distinct
> signature-based dbfawk file to render a new set
> differently, unless one 
> modifies the list of attributes in the shapefile
> (i.e. redoes the dbf file).  
> The per-signature files in the config directory are
> set up for dealing with 
> weather alerts, and if you want your tiled files to
> be used for something else 
> with different rendering, you have no choice other
> than to use per-file dbfawk 
> files, or hack the .dbf files so they have different
> signatures.
> 
> I use the county files for two purposes myself, for
> regular weather alert 
> display, and as a vector overlay to see the counties
> all the time.  To do this
> requires two different sets of rendering rules, so
> my approach to getting
> around the limitation is to have a separate
> directory in the maps folder with 
> symlinks to the county files in the
> /usr/local/share/xastir/Counties directory,
> but with different names:
> 
> ls -l /usr/local/share/xastir/maps/counties/c.???
> lrwxr-x---  1 tvrusso  tvrusso    51 Nov  7  2005
> c.dbf ->
> /usr/local/share/xastir/Counties/c_08au05.dbf
> lrwxr-x---  1 tvrusso  tvrusso    51 Nov  7  2005
> c.shp ->
> /usr/local/share/xastir/Counties/c_08au05.shp
> lrwxr-x---  1 tvrusso  tvrusso    51 Nov  7  2005
> c.shx ->
> /usr/local/share/xastir/Counties/c_08au05.shx
> 
> and a per-file dbfawk file with different rendering
> rules than the default
> rules for wx alerts:
> -rw-r-----  1 tvrusso  tvrusso  2598 Aug  7  2006
> c.dbfawk
> 
> So without tinkering with the .dbf file, the only
> option would be something
> similar.  So if you have files c1.shp, c2.shp,
> c3.shp, you could have a c.dbfawk
> with special rendering, then symlink c1.dbfawk,
> c2.dbfawk, and c3.dbfawk to
> that single file.
> 
> Once you tinker with the dbf file to change its
> signature to something unique,
> however, you could make a new signature-based file
> and just stuff it into
> the config directory instead.  I am not aware of a
> simple tool that can 
> do this dbf modification easily --- you might have
> to tinker with the 
> shapefile splitting tools (I think you might be
> talking about the ones on my
> http://www.swcp.com/~russo/shape_web/ site, which
> are very simple and could
> be hacked for this purpose).

Actually, I do have two copies of the county files for
the same reason you do, one to show weather alerts and
one to show counties.  I'm only trying to tinker with
the dbfawk file, not the dbf file and only for the
county display not the weather alerts.  Weather alerts
are still using an unmodified dbf file (one piece, no
tiles) while the constant display is using the tiles
for convenience.

But what you wrote answers my question that the tiles
are going to need the per-file modification otherwise
the default dbfawk file with matching signature will
override it.  Fortunately, generating a slew of
symlinks based on the base file names in a directory
is easy to do in Linux. :)

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the Xastir mailing list