[Geoserver-devel] Printing layers and its labels

Hello,

Well, I posted this question yesterday but maybe I didn't make myself clear.
There it goes again...

I have some shapefiles that describe the streets of a given city. Well, with
some viewers I can choose an attribute to print its value over the streets
(which is the street names - each street with its respective name). However,
I couldn't find a way to tell the renderer I'd like to choose an attribute
to be rendered with the polygons so that I would have the picture of the
streets and their names... Is it possible?

Thanks in advance.

Calegari San

Yes, you have to create a style with two symbolizer, one line simbolizer
for the streeet itself, and text symbolizer that uses the attribute as the
label.

An XML style gui builder is in the works, but I don't know when I will find
the time to finish it.

Best regards
Andrea Aime

Aurélio Calegari wrote:

Hello,

Well, I posted this question yesterday but maybe I didn't make myself clear.
There it goes again...

I have some shapefiles that describe the streets of a given city. Well, with
some viewers I can choose an attribute to print its value over the streets
(which is the street names - each street with its respective name). However,
I couldn't find a way to tell the renderer I'd like to choose an attribute
to be rendered with the polygons so that I would have the picture of the
streets and their names... Is it possible?

Thanks in advance.

Calegari San

-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Thanx Andrea!

Is there a documentation of these styles. I have created some styles, but I
think there should be a "how to..." document or something like! Do you know
where I can find it. It's not really necessary an IDE, but just the
description of the XML tags and usage.

Thanks again

Calegari San

----- Original Message -----
From: "Andrea Aime" <andrea.aime@anonymised.com>
To: "Aurélio Calegari" <aurelio@anonymised.com>
Cc: <geoserver-devel@lists.sourceforge.net>
Sent: Tuesday, January 20, 2004 9:03 AM
Subject: Re: [Geoserver-devel] Printing layers and its labels

Yes, you have to create a style with two symbolizer, one line simbolizer
for the streeet itself, and text symbolizer that uses the attribute as the
label.

An XML style gui builder is in the works, but I don't know when I will

find

the time to finish it.

Best regards
Andrea Aime

Aurélio Calegari wrote:

> Hello,
>
> Well, I posted this question yesterday but maybe I didn't make myself

clear.

> There it goes again...
>
> I have some shapefiles that describe the streets of a given city. Well,

with

> some viewers I can choose an attribute to print its value over the

streets

> (which is the street names - each street with its respective name).

However,

> I couldn't find a way to tell the renderer I'd like to choose an

attribute

> to be rendered with the polygons so that I would have the picture of the
> streets and their names... Is it possible?
>
> Thanks in advance.
>
> Calegari San
>
>
>
> -------------------------------------------------------
> The SF.Net email is sponsored by EclipseCon 2004
> Premiere Conference on Open Tools Development and Integration
> See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
> http://www.eclipsecon.org/osdn
> _______________________________________________
> Geoserver-devel mailing list
> Geoserver-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geoserver-devel
>

Aurélio Calegari wrote:

Thanx Andrea!

Is there a documentation of these styles. I have created some styles, but I
think there should be a "how to..." document or something like! Do you know
where I can find it. It's not really necessary an IDE, but just the
description of the XML tags and usage.

We have followed the SLD (Styled Layer Descriptor) specification by OpenGis,
so go to the opengis site and download the SLD specification.

Best regards
Andrea Aime

At 13:33 20/01/2004, Aurélio Calegari wrote:

Thanx Andrea!

Is there a documentation of these styles. I have created some styles, but I
think there should be a "how to..." document or something like! Do you know
where I can find it. It's not really necessary an IDE, but just the
description of the XML tags and usage.

If you look in the GeoTools2 renderer-styling module you'll see some examples of how the styling works.
I've included the text test sld code and an image of the output.

Hope that helps

Ian

(attachments)

sample.sld (22.7 KB)
TextTest.png

Thanks Ian…

It was really quite usefull. Well, I also took a glance of the SLD specs and built the following XML:

<?xml version="1.0" encoding="UTF-8"?> Ruas desbotadas por Aurelio Calegari The title of the layer A styling layer used for the unit tests of sldstyler polyshp feature #C1873D 1 **** **NAME** **** **Serif** **10** **** **** **#000000** **** ****

The red-highlighted text is what’s new in my XML, however the result is something like:

Well, then observing your example, I replaced the blue-highlighted text in the above XML by: NAME
And what I expected took place in this case:

Lot’s of name… But a question remains… The name of the parameter I want ot print is “Name”, as defined in my SHP file. Take a look bellow:

Do you have any idea about what might be going wrong onde I can get the real name attributes printed in the image?

Thanks again

Aurelio

----- Original Message -----
From: “Ian Turton” <i.turton@anonymised.com>
To: “Aurélio Calegari” <aurelio@anonymised.com>
Cc: <geoserver-devel@lists.sourceforge.net>
Sent: Tuesday, January 20, 2004 10:41 AM
Subject: Re: [Geoserver-devel] Printing layers and its labels

At 13:33 20/01/2004, Aurélio Calegari wrote:

Thanx Andrea!

Is there a documentation of these styles. I have created some styles, but I
think there should be a “how to…” document or something like! Do you know
where I can find it. It’s not really necessary an IDE, but just the
description of the XML tags and usage.

If you look in the GeoTools2 renderer-styling module you’ll see some
examples of how the styling works.
I’ve included the text test sld code and an image of the output.

Hope that helps

Ian

Aurélio Calegari wrote:

...

Do you have any idea about what might be going wrong onde I can get the real name attributes printed in the image?
Thanks again
Aurelio

Wild guess: case sensitivity. The rendering code does not know that the
dbf attribute names are case independent, so I guess that the name
in the DBF file is not "NAME", but maybe "Name", "name", whatever....
I may just be plain wrong thought...

Best regards
Andrea Aime

Well, then observing your example, I replaced the blue-highlighted text in the above XML by: <Label><Literal>NAME</Literal></Label>
And what I expected took place in this case:

Lot's of name... But a question remains... The name of the parameter I
want ot print is "Name", as defined in my SHP file. Take a look bellow:

Do you have any idea about what might be going wrong onde I can get the real name attributes printed in the image?

The SLD experts may correct me, but since they aren't answering, in my
glance at the sld spec I think the xml should maybe be
<Label><PropertyName>NAME</PropertyName></Label>

instead of:
<Label><Literal>NAME</Literal></Label>

This guess is more from my Filter spec knowledge, so I may be missing
something, but you should give it a try. The PropertyName might be case
sensitive, so maybe try out <Label><PropertyName>name</PropertyName></Label>
as well.

Chris

Thanks again

Aurelio

----- Original Message -----
From: "Ian Turton" <i.turton@anonymised.com>
To: "Aurélio Calegari" <aurelio@anonymised.com>
Cc: <geoserver-devel@lists.sourceforge.net>
Sent: Tuesday, January 20, 2004 10:41 AM
Subject: Re: [Geoserver-devel] Printing layers and its labels

At 13:33 20/01/2004, Aurélio Calegari wrote:
>Thanx Andrea!
>
>Is there a documentation of these styles. I have created some styles, but I
>think there should be a "how to..." document or something like! Do you know
>where I can find it. It's not really necessary an IDE, but just the
>description of the XML tags and usage.

If you look in the GeoTools2 renderer-styling module you'll see some
examples of how the styling works.
I've included the text test sld code and an image of the output.

Hope that helps

Ian

--

Hi Chris

The SLD experts may correct me, but since they aren't answering, in my
glance at the sld spec I think the xml should maybe be
<Label><PropertyName>NAME</PropertyName></Label>

I made that... And I couldn't get that attribute printed in the generated pic.
So, I changed to <Literal> in order to check if I could have the literal "NAME" printed. In this case it worked, but not with
<PropertyName/> tag.

This problem is still happening.

Thanx anyway

Regards,

Aurelio

----- Original Message -----
From: "Chris Holmes" <cholmes@anonymised.com>
To: "Aurélio Calegari" <aurelio@anonymised.com>
Cc: "Ian Turton" <i.turton@anonymised.com>; <geoserver-devel@lists.sourceforge.net>
Sent: Wednesday, January 21, 2004 1:28 PM
Subject: Re: [Geoserver-devel] Printing layers and its labels

> Well, then observing your example, I replaced the blue-highlighted text in the above XML by:

<Label><Literal>NAME</Literal></Label>

> And what I expected took place in this case:
>
> Lot's of name... But a question remains... The name of the parameter I
> want ot print is "Name", as defined in my SHP file. Take a look bellow:
>
> Do you have any idea about what might be going wrong onde I can get the real name attributes printed in the image?

The SLD experts may correct me, but since they aren't answering, in my
glance at the sld spec I think the xml should maybe be
<Label><PropertyName>NAME</PropertyName></Label>

instead of:
<Label><Literal>NAME</Literal></Label>

This guess is more from my Filter spec knowledge, so I may be missing
something, but you should give it a try. The PropertyName might be case
sensitive, so maybe try out <Label><PropertyName>name</PropertyName></Label>
as well.

Chris

>
> Thanks again
>
> Aurelio
>
>
>
>
> ----- Original Message -----
> From: "Ian Turton" <i.turton@anonymised.com>
> To: "Aurélio Calegari" <aurelio@anonymised.com>
> Cc: <geoserver-devel@lists.sourceforge.net>
> Sent: Tuesday, January 20, 2004 10:41 AM
> Subject: Re: [Geoserver-devel] Printing layers and its labels
>
>
> At 13:33 20/01/2004, Aurélio Calegari wrote:
> >Thanx Andrea!
> >
> >Is there a documentation of these styles. I have created some styles, but I
> >think there should be a "how to..." document or something like! Do you know
> >where I can find it. It's not really necessary an IDE, but just the
> >description of the XML tags and usage.
>
> If you look in the GeoTools2 renderer-styling module you'll see some
> examples of how the styling works.
> I've included the text test sld code and an image of the output.
>
> Hope that helps
>
> Ian
>
>

--