A Label can be heterogenous - it can be applied to an edge which is part of both an area and a linear geometry.

I think this is why this was changed, once it was realized that this situation could occur.

Have you tested your failure case in JTS?
CodeKaizen wrote:
Hi JTS devs -

I'm tracking down a problem with NTS by tracing JTS, and I've found
the problem is due to an encoding of a Label's TopologyLocation for a
given geometry. When I initialize a Label to be an area label, the
other argument is not initialized, and is later treated as a non-area.

In EdgeEndStar is where the check goes wrong. In the method
propagateSideLabels(int geomIndex), there is a check to determine if
the label is an area by calling Label.isArea(int index). Here is the
relevant code (line 288 in
com.vividsolutions.jts.geomgraph.EdgeEndStar):

    // set side labels (if any)
    // if (label.isArea()) { //ORIGINAL
    if (label.isArea(geomIndex)) {

I've determined that by calling label.IsArea() in NTS the problem is
solved. I was surprised to find this is how the JTS code had been, but
it was changed.

I'm curious about why this was changed. It appears to be a performance
optimization, since a label seems to be a line label or an area label,
and both locations either have 1 position or 3 positions, but not a
combination of locations with a combination of 1 and 3 positions (a
line/area or area/line label). However, I'm afraid I'm missing enough
experience to determine this definitively. As far as I can reason,
label encoding could theoretically go either way (by having
homogeneous labels [line/line or area/area], or heterogeneous labels
[line/area or area/line]).

Could someone shed light onto why this code was changed?

Could someone also correct me if I'm wrong about having heterogeneous
labels being possible?

thanks,
-rory
_______________________________________________
jts-devel mailing list
[email protected]
http://lists.refractions.net/mailman/listinfo/jts-devel


--
Martin Davis
Senior Technical Architect
Refractions Research, Inc.
(250) 383-3022

_______________________________________________
jts-devel mailing list
[email protected]
http://lists.refractions.net/mailman/listinfo/jts-devel

Reply via email to