[Geoserver-users] Labeling in SLD - label the right field

Hi all,

I have problem with labeling - I can't figure out how to pick the right
field to label!

My data looks like this (from a wfs request):

<http://osgeo-org.1560.n6.nabble.com/file/n5023729/quest.jpg&gt;

What I want to label is stored in the field named 'oso:katunumero' (1). As
you can see, it is now stored under the field 'oso:osoite' (2).

Seems like an easy issue, but I can't figure out how to pick that
'oso:katunumero' from there.
Labeling it with <Label><ogc:PropertyName>katunumero</ ></ > gives an error:
.... The style specifies an attribute of katunumero and the layer is:
mtk:oso_Osoitepiste

        <TextSymbolizer>
          <Label>
            <ogc:PropertyName>??</ogc:PropertyName>
...

regards,
Jakob

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Labeling-in-SLD-label-the-right-field-tp5023729.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

I believe you should include the prefix along with the name:

ogc:PropertyNameoso:katunumero</ogc:PropertyName>

···

On Tue, Dec 18, 2012 at 6:08 AM, obtin <jventin@anonymised.com> wrote:

Hi all,

I have problem with labeling - I can’t figure out how to pick the right
field to label!

My data looks like this (from a wfs request):

<http://osgeo-org.1560.n6.nabble.com/file/n5023729/quest.jpg>

What I want to label is stored in the field named ‘oso:katunumero’ (1). As
you can see, it is now stored under the field ‘oso:osoite’ (2).

Seems like an easy issue, but I can’t figure out how to pick that
‘oso:katunumero’ from there.
Labeling it with ogc:PropertyNamekatunumero</ ></ > gives an error:
… The style specifies an attribute of katunumero and the layer is:
mtk:oso_Osoitepiste

?? ...

regards,
Jakob


View this message in context: http://osgeo-org.1560.n6.nabble.com/Labeling-in-SLD-label-the-right-field-tp5023729.html
Sent from the GeoServer - User mailing list archive at Nabble.com.


LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d


Geoserver-users mailing list
Geoserver-users@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

thanks for that tip, unfortunately it did not seem to work..

for clarity:

when using
<Label>
<ogc:PropertyName>rakenustunnus</ogc:PropertyName>
</Label>

it works fine and labels whatever is stored under oso:rakennustunnus.

Any further ideas?

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Labeling-in-SLD-label-the-right-field-tp5023729p5023844.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

How is the hierarchical GML being generated? Are you using AppSchema, or is the underlying Datastore creating this?

AFAIK you can’t refer to nested attributes in SLD elements (but perhaps someone else can confirm if that is correct). If so, you need to find a way to “flatten” the layer schema to make the desired attribute accessible.

On Tue, Dec 18, 2012 at 3:08 AM, obtin <jventin@anonymised.com> wrote:

Hi all,

I have problem with labeling - I can’t figure out how to pick the right
field to label!

My data looks like this (from a wfs request):

<http://osgeo-org.1560.n6.nabble.com/file/n5023729/quest.jpg>

What I want to label is stored in the field named ‘oso:katunumero’ (1). As
you can see, it is now stored under the field ‘oso:osoite’ (2).

Seems like an easy issue, but I can’t figure out how to pick that
‘oso:katunumero’ from there.
Labeling it with ogc:PropertyNamekatunumero</ ></ > gives an error:
… The style specifies an attribute of katunumero and the layer is:
mtk:oso_Osoitepiste

?? ...

regards,
Jakob


View this message in context: http://osgeo-org.1560.n6.nabble.com/Labeling-in-SLD-label-the-right-field-tp5023729.html
Sent from the GeoServer - User mailing list archive at Nabble.com.


LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d


Geoserver-users mailing list
Geoserver-users@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Martin Davis
OpenGeo - http://opengeo.org
Expert service straight from the developers.

On Wed, Dec 19, 2012 at 4:16 PM, Martin Davis <mdavis@anonymised.com> wrote:

How is the hierarchical GML being generated? Are you using AppSchema, or is the underlying Datastore creating this?

AFAIK you can’t refer to nested attributes in SLD elements (but perhaps someone else can confirm if that is correct). If so, you need to find a way to “flatten” the layer schema to make the desired attribute accessible.

I believe Niels did work in order to make it possible to access a nested
property via xpath some time ago, with features generated by app-schema

Cc’ed him

Cheers
Andrea

==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


That is true. With the app-schema module included (in the future, complex module) you are able to evaluate x-paths against complex features (returns properties) or against feature types (returns descriptors). This has also been applied in SLD files for using WMS with app-schema. There are examples that demonstrate that this works.

Kind Regards
Niels

On 12/19/2012 04:32 PM, Andrea Aime wrote:

On Wed, Dec 19, 2012 at 4:16 PM, Martin Davis <mdavis@anonymised.com <mailto:mdavis@anonymised.com>> wrote:

    How is the hierarchical GML being generated? Are you using
    AppSchema, or is the underlying Datastore creating this?

    AFAIK you can't refer to nested attributes in SLD <PropertyName>
    elements (but perhaps someone else can confirm if that is
    correct). If so, you need to find a way to "flatten" the layer
    schema to make the desired attribute accessible.

I believe Niels did work in order to make it possible to access a nested
property via xpath some time ago, with features generated by app-schema

Cc'ed him

Cheers
Andrea

--

Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

Are the examples documented anywhere for the OP to look at?

On Thu, Dec 20, 2012 at 4:47 AM, Niels Charlier <niels@anonymised.com…4960…> wrote:

That is true. With the app-schema module included (in the future, complex module) you are able to evaluate x-paths against complex features (returns properties) or against feature types (returns descriptors). This has also been applied in SLD files for using WMS with app-schema. There are examples that demonstrate that this works.

Kind Regards
Niels

On 12/19/2012 04:32 PM, Andrea Aime wrote:

On Wed, Dec 19, 2012 at 4:16 PM, Martin Davis <mdavis@anonymised.com> wrote:

How is the hierarchical GML being generated? Are you using AppSchema, or is the underlying Datastore creating this?

AFAIK you can’t refer to nested attributes in SLD elements (but perhaps someone else can confirm if that is correct). If so, you need to find a way to “flatten” the layer schema to make the desired attribute accessible.

I believe Niels did work in order to make it possible to access a nested
property via xpath some time ago, with features generated by app-schema

Cc’ed him

Cheers
Andrea

==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


Martin Davis
OpenGeo - http://opengeo.org
Expert service straight from the developers.

Read here for more information
http://docs.geoserver.org/latest/en/user/data/app-schema/wms-support.html

With examples I mainly meant unit tests. Look in the app-schema-tests module in geoserver for the following classes:
WmsGetMapTest
WmsGetFeatureInfoTest
WmsGetLegendGraphicTest

They use SLD files also included in the module.

Hope this helps.

Cheers
Niels

On 20/12/12 15:40, Martin Davis wrote:

Are the examples documented anywhere for the OP to look at?

On Thu, Dec 20, 2012 at 4:47 AM, Niels Charlier <niels@anonymised.com <mailto:niels@anonymised.com>> wrote:

    That is true. With the app-schema module included (in the future,
    complex module) you are able to evaluate x-paths against complex
    features (returns properties) or against feature types (returns
    descriptors). This has also been applied in SLD files for using
    WMS with app-schema. There are examples that demonstrate that this
    works.

    Kind Regards
    Niels

    On 12/19/2012 04:32 PM, Andrea Aime wrote:

    On Wed, Dec 19, 2012 at 4:16 PM, Martin Davis <mdavis@anonymised.com
    <mailto:mdavis@anonymised.com>> wrote:

        How is the hierarchical GML being generated? Are you using
        AppSchema, or is the underlying Datastore creating this?

        AFAIK you can't refer to nested attributes in SLD
        <PropertyName> elements (but perhaps someone else can confirm
        if that is correct). If so, you need to find a way to
        "flatten" the layer schema to make the desired attribute
        accessible.

    I believe Niels did work in order to make it possible to access a
    nested
    property via xpath some time ago, with features generated by
    app-schema

    Cc'ed him

    Cheers
    Andrea

    -- ==
    Our support, Your Success! Visit http://opensdi.geo-solutions.it
    for more information.
    ==

    Ing. Andrea Aime
    @geowolf
    Technical Lead

    GeoSolutions S.A.S.
    Via Poggio alle Viti 1187
    55054 Massarosa (LU)
    Italy
    phone: +39 0584 962313 <tel:%2B39%200584%20962313>
    fax: +39 0584 1660272 <tel:%2B39%200584%201660272>
    mob: +39 339 8844549 <tel:%2B39%20%C2%A0339%208844549>

    http://www.geo-solutions.it
    http://twitter.com/geosolutions_it

    -------------------------------------------------------

--
Martin Davis
OpenGeo - http://opengeo.org/&gt;
Expert service straight from the developers.

Hi,

back at work after some vacation.

In our case, the WFS-sevice is produced outside Geoserver, on Degree WFS /
Oracle 11g Locator platform. Is it possible to apply Geoserver nested
property via xpath in a situation where the complex featured WFS-service is
gotten outside of Geoserver?

Regards,
Jakob

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Labeling-in-SLD-label-the-right-field-tp5023729p5025603.html
Sent from the GeoServer - User mailing list archive at Nabble.com.