[Xastir-dev] Weather alert county labels

Tom Russo russo at bogodyn.org
Wed Jan 12 23:05:50 EST 2005


On Wed, Jan 12, 2005 at 07:04:50PM -0700, we recorded a bogon-computron collision of the <russo at bogodyn.org> flavor, containing:
> > Is this a bug in the county files, the dbfawk code, the rtree code, the 
> > weather alert code, or what? I certainly don't want to track this one 
> > down. :-P
> 
> I would be very, very surprised if it were in rtree, because when there's
> a weather alert the rtree code is bypassed (you don't need to find a list
> of all shapes enclosed in the current region, you already know which one
> to display).  

Confirmed --- the code does the same thing with rtree disabled.

> could be dbfawk

Well, in a sense, it is dbfawk, and in a sense it is not --- the non-dbfawk
code seems not to display labels on the weather alerts at all as far as
I can tell.

By zooming in on a single weather alert area with all other maps disabled and
turning on debug level 16, I see that the first time the county is drawn,
dbfawk-enabled code reports the name of the shape as having been properly 
set, and non-dbfawk code reports the name of the shape, too.  But neither
actually displays it.  However, a little while later the map is redrawn and
the block of debugging output is repeated.  Interestingly enough, when I do
this with dbfawk enabled the label appears the second time.  However the
non-dbfawk code does NOT display the label the second time through, as far
as I can see.  From my read of the code, the label name is actually not
set for wx county shapefiles in the non-dbfawk version, even though it's 
available from the shapefile -- the only polygon shapes that get labels
with non-dbfawk code are those the code recognizes as lakes or cities.

Unfortunately, I do not see why there are two passes through 
draw_shapefile_map when the alert is displayed, how it can be that the
first pass skips the labels --- the name of the shape is clearly getting
set properly.

The label drawing part of the polygon code is conditional on several 
factors, but when I add a debug line right before the draw_centered_label_text 
call, both passes indicate that they're calling the label-drawing routine, and 
with the same name and color.  But the first one doesn't display.  I'm 
committing map_shp.c with this added debugging output (selectable with 
debug_level |= 16) in a second if anyone 
else cares to dig.

And another thing --- if I zoom out and then zoom back in the process repeats.
The shape gets drawn once with no label (but the debug output says it's
drawing labels), and then again a little while later with labels.

-- 
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/
 "When life gives you lemons, find someone with a paper cut."



More information about the Xastir-dev mailing list