[Geoserver-devel] Labeling

Rong,

About line 135 of LabelCacheDefault, you'll see:

if( !labelCache.containsKey(textStyle.getLabel())){
  labelCache.put(textStyle.getLabel(), new LabelCacheItem(textStyle,
shape));
}else{
  LabelCacheItem item=(LabelCacheItem)
labelCache.get(textStyle.getLabel());
  item.getGeoms().add(shape.getGeometry());
}

This is it building up the 'groups' of geometries with the same label.

If you change all of that to just:

labelCache.put(textStyle.getLabel(), new LabelCacheItem(textStyle,
shape));

you'll "turn off" the grouping.

To allow labels to overlap, look near line 192 of the same file:

if( overlappingItems(glyphVector, tempTransform, glyphs) )
  continue;

Remove these two lines and overlapping labels should be okay.

I havent tried either of thes two changes - but they should allow you to
try things out so you'll be ready for your deadline. Please tell me if
they do what I expect them to do.

Thanks,

Dave

----------------------------------------------------------
This mail sent through IMP: https://webmail.limegroup.com/

Hi, Dave,
   I'll try this. I'll let you know when I'm done.
   Thank you very much.
   Rong.

Rong,

About line 135 of LabelCacheDefault, you'll see:

if( !labelCache.containsKey(textStyle.getLabel())){
  labelCache.put(textStyle.getLabel(), new LabelCacheItem(textStyle,
shape));
}else{
  LabelCacheItem item=(LabelCacheItem)
labelCache.get(textStyle.getLabel());
  item.getGeoms().add(shape.getGeometry());
}

This is it building up the 'groups' of geometries with the same label.

If you change all of that to just:

labelCache.put(textStyle.getLabel(), new LabelCacheItem(textStyle,
shape));

you'll "turn off" the grouping.

To allow labels to overlap, look near line 192 of the same file:

if( overlappingItems(glyphVector, tempTransform, glyphs) )
  continue;

Remove these two lines and overlapping labels should be okay.

I havent tried either of thes two changes - but they should allow you to
try things out so you'll be ready for your deadline. Please tell me if
they do what I expect them to do.

Thanks,

Dave

----------------------------------------------------------
This mail sent through IMP: https://webmail.limegroup.com/

Rong,

About line 135 of LabelCacheDefault, you'll see:

if( !labelCache.containsKey(textStyle.getLabel())){
  labelCache.put(textStyle.getLabel(), new LabelCacheItem(textStyle,
shape));
}else{
  LabelCacheItem item=(LabelCacheItem)
labelCache.get(textStyle.getLabel());
  item.getGeoms().add(shape.getGeometry());
}

This is it building up the 'groups' of geometries with the same label.

If you change all of that to just:

labelCache.put(textStyle.getLabel(), new LabelCacheItem(textStyle,
shape));

you'll "turn off" the grouping.

To allow labels to overlap, look near line 192 of the same file:

if( overlappingItems(glyphVector, tempTransform, glyphs) )
  continue;

Remove these two lines and overlapping labels should be okay.

I havent tried either of thes two changes - but they should allow you to
try things out so you'll be ready for your deadline. Please tell me if
they do what I expect them to do.

Thanks,

Dave

----------------------------------------------------------
This mail sent through IMP: https://webmail.limegroup.com/

-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September
19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Hi, Dave,
  I have tried to change the two places as you said. But it seems not work
as we expect. It still cannot generate all label when they are same.
What I did is use maven to compile and install the jars. I got a
main-2.1.RC1.jar. Then I copy this one to
C:\GeoServer1.3\server\geoserver\WEB-INF\lib and overwirte the
gt2-main.jar. Any suggestions?
  Thank you very much.
  Rong.

Rong,

About line 135 of LabelCacheDefault, you'll see:

if( !labelCache.containsKey(textStyle.getLabel())){
  labelCache.put(textStyle.getLabel(), new LabelCacheItem(textStyle,
shape));
}else{
  LabelCacheItem item=(LabelCacheItem)
labelCache.get(textStyle.getLabel());
  item.getGeoms().add(shape.getGeometry());
}

This is it building up the 'groups' of geometries with the same label.

If you change all of that to just:

labelCache.put(textStyle.getLabel(), new LabelCacheItem(textStyle,
shape));

you'll "turn off" the grouping.

To allow labels to overlap, look near line 192 of the same file:

if( overlappingItems(glyphVector, tempTransform, glyphs) )
  continue;

Remove these two lines and overlapping labels should be okay.

I havent tried either of thes two changes - but they should allow you to
try things out so you'll be ready for your deadline. Please tell me if
they do what I expect them to do.

Thanks,

Dave

----------------------------------------------------------
This mail sent through IMP: https://webmail.limegroup.com/

-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September
19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Hi, Dave,
  I found the problem is because the labelCache is a Map which cannot
allowed duplicate key. The key is the value of the label property. I'll
try change the labelCache to two ArrayList. One store the lable value
with the other store the LableCacheItem and the corrreponding label
value and the LabelCacheItem have the same index. I'll try this. I'll
let you know the results.
  Thanks
  Rong

Hi, Dave,
  I have tried to change the two places as you said. But it seems not work
as we expect. It still cannot generate all label when they are same.
What I did is use maven to compile and install the jars. I got a
main-2.1.RC1.jar. Then I copy this one to
C:\GeoServer1.3\server\geoserver\WEB-INF\lib and overwirte the
gt2-main.jar. Any suggestions?
  Thank you very much.
  Rong.

Rong,

About line 135 of LabelCacheDefault, you'll see:

if( !labelCache.containsKey(textStyle.getLabel())){
  labelCache.put(textStyle.getLabel(), new LabelCacheItem(textStyle,
shape));
}else{
  LabelCacheItem item=(LabelCacheItem)
labelCache.get(textStyle.getLabel());
  item.getGeoms().add(shape.getGeometry());
}

This is it building up the 'groups' of geometries with the same label.

If you change all of that to just:

labelCache.put(textStyle.getLabel(), new LabelCacheItem(textStyle,
shape));

you'll "turn off" the grouping.

To allow labels to overlap, look near line 192 of the same file:

if( overlappingItems(glyphVector, tempTransform, glyphs) )
  continue;

Remove these two lines and overlapping labels should be okay.

I havent tried either of thes two changes - but they should allow you to
try things out so you'll be ready for your deadline. Please tell me if
they do what I expect them to do.

Thanks,

Dave

----------------------------------------------------------
This mail sent through IMP: https://webmail.limegroup.com/

-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September
19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing &
QA
Security * Process Improvement & Measurement *
http://www.sqe.com/bsce5sf
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September
19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Hi, Dave,
  Cheers, I figure out the problem. I got the result as what I expected. I
just change the lableCache to a ArrayList. The key was not used because
it use the the label inside textStle. Maybe later, please point me where
can I add a label group switch in the SLD file so that we can compatible
with the standard the SLD specifcation.
  Thank you very much.
  Rong.

Hi, Dave,
  I found the problem is because the labelCache is a Map which cannot
allowed duplicate key. The key is the value of the label property. I'll
try change the labelCache to two ArrayList. One store the lable value
with the other store the LableCacheItem and the corrreponding label
value and the LabelCacheItem have the same index. I'll try this. I'll
let you know the results.
  Thanks
  Rong

Hi, Dave,
  I have tried to change the two places as you said. But it seems not
work
as we expect. It still cannot generate all label when they are same.
What I did is use maven to compile and install the jars. I got a
main-2.1.RC1.jar. Then I copy this one to
C:\GeoServer1.3\server\geoserver\WEB-INF\lib and overwirte the
gt2-main.jar. Any suggestions?
  Thank you very much.
  Rong.

Rong,

About line 135 of LabelCacheDefault, you'll see:

if( !labelCache.containsKey(textStyle.getLabel())){
  labelCache.put(textStyle.getLabel(), new LabelCacheItem(textStyle,
shape));
}else{
  LabelCacheItem item=(LabelCacheItem)
labelCache.get(textStyle.getLabel());
  item.getGeoms().add(shape.getGeometry());
}

This is it building up the 'groups' of geometries with the same label.

If you change all of that to just:

labelCache.put(textStyle.getLabel(), new LabelCacheItem(textStyle,
shape));

you'll "turn off" the grouping.

To allow labels to overlap, look near line 192 of the same file:

if( overlappingItems(glyphVector, tempTransform, glyphs) )
  continue;

Remove these two lines and overlapping labels should be okay.

I havent tried either of thes two changes - but they should allow you
to
try things out so you'll be ready for your deadline. Please tell me if
they do what I expect them to do.

Thanks,

Dave

----------------------------------------------------------
This mail sent through IMP: https://webmail.limegroup.com/

-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September
19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing &
QA
Security * Process Improvement & Measurement *
http://www.sqe.com/bsce5sf
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September
19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing &
QA
Security * Process Improvement & Measurement *
http://www.sqe.com/bsce5sf
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September
19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel