<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://ojwiki.soldin.de/index.php?action=history&amp;feed=atom&amp;title=Beanshell%3ALimit_labels_to_one_per_street</id>
	<title>Beanshell:Limit labels to one per street - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://ojwiki.soldin.de/index.php?action=history&amp;feed=atom&amp;title=Beanshell%3ALimit_labels_to_one_per_street"/>
	<link rel="alternate" type="text/html" href="http://ojwiki.soldin.de/index.php?title=Beanshell:Limit_labels_to_one_per_street&amp;action=history"/>
	<updated>2026-06-03T11:44:35Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.5</generator>
	<entry>
		<id>http://ojwiki.soldin.de/index.php?title=Beanshell:Limit_labels_to_one_per_street&amp;diff=211&amp;oldid=prev</id>
		<title>Mentaer at 00:06, 12 October 2009</title>
		<link rel="alternate" type="text/html" href="http://ojwiki.soldin.de/index.php?title=Beanshell:Limit_labels_to_one_per_street&amp;diff=211&amp;oldid=prev"/>
		<updated>2009-10-12T00:06:10Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 00:06, 12 October 2009&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;Hi everyone,&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;Hi everyone,&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#039;&amp;#039;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;I&amp;#039;m trying to show a label (name) of a street that is formed by many segments. When I enable this label, the name is repeated through the entire street (as shown in the attached image).&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#039;&amp;#039;&lt;/ins&gt;I&amp;#039;m trying to show a label (name) of a street that is formed by many segments. When I enable this label, the name is repeated through the entire street (as shown in the attached image).&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#039;&amp;#039;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Is it possible to have only one label for each street? Is there any plugin that perform this fuctionality?&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#039;&amp;#039;&lt;/ins&gt;Is it possible to have only one label for each street? Is there any plugin that perform this fuctionality?&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#039;&amp;#039;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Thanks in advance, Adriana&amp;#039;&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#039;&amp;#039;&lt;/ins&gt;Thanks in advance, Adriana&amp;#039;&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Hi Adriana: BeanShell to the rescue! The BeanShell script below modifies the Label style to draw each street name once per screen.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Hi Adriana: BeanShell to the rescue! The BeanShell script below modifies the Label style to draw each street name once per screen.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Mentaer</name></author>
	</entry>
	<entry>
		<id>http://ojwiki.soldin.de/index.php?title=Beanshell:Limit_labels_to_one_per_street&amp;diff=210&amp;oldid=prev</id>
		<title>Mentaer: Created page with &#039;&#039;&#039;Hi everyone,  I&#039;m trying to show a label (name) of a street that is formed by many segments. When I enable this label, the name is repeated through the entire street (as shown …&#039;</title>
		<link rel="alternate" type="text/html" href="http://ojwiki.soldin.de/index.php?title=Beanshell:Limit_labels_to_one_per_street&amp;diff=210&amp;oldid=prev"/>
		<updated>2009-10-12T00:05:20Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;#039;&amp;#039;&amp;#039;Hi everyone,  I&amp;#039;m trying to show a label (name) of a street that is formed by many segments. When I enable this label, the name is repeated through the entire street (as shown …&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;#039;&amp;#039;Hi everyone,&lt;br /&gt;
&lt;br /&gt;
I&amp;#039;m trying to show a label (name) of a street that is formed by many segments. When I enable this label, the name is repeated through the entire street (as shown in the attached image).&lt;br /&gt;
&lt;br /&gt;
Is it possible to have only one label for each street? Is there any plugin that perform this fuctionality?&lt;br /&gt;
&lt;br /&gt;
Thanks in advance, Adriana&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Hi Adriana: BeanShell to the rescue! The BeanShell script below modifies the Label style to draw each street name once per screen.&lt;br /&gt;
This is a clever way to meet your requirement.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Click View &amp;gt; BeanShell. The BeanShell window will appear.&lt;br /&gt;
* Copy the following code, then paste it into the BeanShell window using Ctrl+V:&lt;br /&gt;
&lt;br /&gt;
 {&lt;br /&gt;
 layerName = &amp;quot;Adriana&amp;#039;s Street Layer&amp;quot;;&lt;br /&gt;
 streetNameAttribute = &amp;quot;STREETNAME&amp;quot;;&lt;br /&gt;
 import com.vividsolutions.jump.feature.Feature;&lt;br /&gt;
 import com.vividsolutions.jump.workbench.model.Layer;&lt;br /&gt;
 import com.vividsolutions.jump.workbench.ui.Viewport;&lt;br /&gt;
 import com.vividsolutions.jump.workbench.ui.renderer.style.LabelStyle;&lt;br /&gt;
 layer = wc.getLayerManager().getLayer(layerName);&lt;br /&gt;
 oldLabelStyle = layer.getLabelStyle();&lt;br /&gt;
 layer.addStyle(new LabelStyle() {&lt;br /&gt;
   streetNamesDrawn = new HashSet();&lt;br /&gt;
   public void initialize(Layer layer) {&lt;br /&gt;
     streetNamesDrawn.clear();&lt;br /&gt;
     super.initialize(layer);&lt;br /&gt;
   }&lt;br /&gt;
   streetName(feature) {&lt;br /&gt;
     return feature.getAttribute(streetNameAttribute);&lt;br /&gt;
   }&lt;br /&gt;
   public void paint(Feature f, Graphics2D g, Viewport viewport) {&lt;br /&gt;
     if (streetNamesDrawn.contains(streetName(f))) { return; }&lt;br /&gt;
     streetNamesDrawn.add(streetName(f));&lt;br /&gt;
     super.paint(f, g, viewport);&lt;br /&gt;
   }&lt;br /&gt;
 });&lt;br /&gt;
 layer.removeStyle(oldLabelStyle);&lt;br /&gt;
 layer.getLabelStyle().setEnabled(true);&lt;br /&gt;
 layer.getLabelStyle().setAttribute(streetNameAttribute);&lt;br /&gt;
 wc.getLayerViewPanel().repaint();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Now street names will be drawn once per screen!&lt;/div&gt;</summary>
		<author><name>Mentaer</name></author>
	</entry>
</feed>