[Geoserver-users] Some questions about GetFeatureInfo and priorities of layers in a WMS

Hello,

I'm Jose Miguel Rubio from IGN (National Geographical Institute) from Spain and we are now thinking of GeoServer as a solution to improve our WMS of the CartoCiudad project (national and seamless database of addresses of Spain). Unfortunately I am not an expert in GeoServer and I have some questions that actually I cannot get solved by myself but I am sure you could help me.

Firstly, when I make a GetFeatureInfo request, it appears an attribute "FID" that does not exist in our Oracle DB. Could it be possible to hide this information?
I have read that a solution to hide attributes is to create a view in our DB, but I do not know if GeoServer admits views without ID (actually the primary key of the table). We are not interested to show neither ID nor FID in GetFeatureInfo responses. (1)

Another question regarding GetFeatureInfo is related to the name of the Featuretype. Could I change the name of the Featuretype instead of using the one from the DB view? In the Admin Tool there is a field called "Alias", I am not sure if this is related with this issue, but it does not work anyway. (2)

Here is an image of an Openlayers client using GeoServer with our data:

1

2

[cid:image001.gif@anonymised.com][cid:image002.gif@anonymised.com][cid:image003.jpg@anonymised.com]

The last question is related to the configuration of priorities when the different layers are drawn. In one layer we have the house numbers and in other one we have the street names. I have designed the corresponding SLD so at certain scales both layers are shown, and always appear a lot of house numbers and few street names. I have changed the font size of the labels but it only improved a little. Is there a way to reverse this situation? What I do not want is to get names and numbers overlapped, but I think street names are more important than house numbers and I would prefer to show those when there was a lot of information. Could it be related to the order in the WMS? Or to some vendor option of text symbolizer element in SLD?
I attach an example very illustrative: you can see a lot of house numbers but the street names are not shown; only when you are at a big scale they begin to appear.

[cid:image004.jpg@anonymised.com]

Thank you very much.

Best regards,

José Miguel Rubio

-------------------------------------------------------------------------------
José Miguel Rubio Iglesias
Subdirección General de Aplicaciones Geográficas
Instituto Geográfico Nacional
C/General Ibáñez de Ibero, 3 28003 MADRID
Despacho: A 0002 Teléfono: 91 597 97 51
E-mail: jmrubio@anonymised.com<mailto:jmrubio@anonymised.com>

image001.gif

image002.gif

image003.jpg

image004.jpg

On Fri, Jan 30, 2009 at 1:31 PM, Rubio Iglesias José Miguel
<jmrubio@anonymised.com> wrote:

Hello,

I'm Jose Miguel Rubio from IGN (National Geographical Institute) from Spain
and we are now thinking of GeoServer as a solution to improve our WMS of the
CartoCiudad project (national and seamless database of addresses of Spain).
Unfortunately I am not an expert in GeoServer and I have some questions that
actually I cannot get solved by myself but I am sure you could help me.

Firstly, when I make a GetFeatureInfo request, it appears an attribute "FID"
that does not exist in our Oracle DB. Could it be possible to hide this
information?

I have read that a solution to hide attributes is to create a view in our
DB, but I do not know if GeoServer admits views without ID (actually the
primary key of the table). We are not interested to show neither ID nor FID
in GetFeatureInfo responses. (1)

Another question regarding GetFeatureInfo is related to the name of the
Featuretype. Could I change the name of the Featuretype instead of using the
one from the DB view? In the Admin Tool there is a field called "Alias", I
am not sure if this is related with this issue, but it does not work anyway.
(2)

Hola Rubio,

the template you are using is just a default/demo geoserver template.
Check out this to create your own template:
http://geoserver.org/display/GEOSDOC/GetFeatureInfo+templates

Or maybe if you like OpenLayers more, make an getFeatureInfo in GML
format by changing info_format=application/vnd.ogc.gml, and then parse
it by OL like this:
http://openlayers.org/dev/examples/GMLParser.html

Here is an image of an Openlayers client using GeoServer with our data:

1

2

The last question is related to the configuration of priorities when the
different layers are drawn. In one layer we have the house numbers and in
other one we have the street names. I have designed the corresponding SLD so
at certain scales both layers are shown, and always appear a lot of house
numbers and few street names. I have changed the font size of the labels but
it only improved a little. Is there a way to reverse this situation? What I
do not want is to get names and numbers overlapped, but I think street names
are more important than house numbers and I would prefer to show those when
there was a lot of information. Could it be related to the order in the WMS?
Or to some vendor option of text symbolizer element in SLD?

I attach an example very illustrative: you can see a lot of house numbers
but the street names are not shown; only when you are at a big scale they
begin to appear.

Thank you very much.

Best regards,

José Miguel Rubio

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

José Miguel Rubio Iglesias

Subdirección General de Aplicaciones Geográficas

Instituto Geográfico Nacional

C/General Ibáñez de Ibero, 3 28003 MADRID

Despacho: A 0002 Teléfono: 91 597 97 51

E-mail: jmrubio@anonymised.com

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
Ivan Grcic

Hi Jose,

The fid is an internal reference that GeoServer uses. Ideally it should be of the form <feature type>.<primary key value>. If the primary key is not accessible then it's not really a meaningful thing.

The alias field is meant for requests, so instead of asking for the layers=someprefix:some_very_confusing_acronym you can just ask for layers=roads , but I'm not sure that this will be reflected in the getfeatureinfo.

Please have a look at the following page, it explains how you can format the output and omit fields: http://geoserver.org/display/GEOSDOC/GetFeatureInfo+templates

I'm not an expert at the label rendering stuff, but I would recommend you try 1.7.2 (see [1]) with the new options, both curved labeling and wrapped labels should help in these cases. GeoServer does collision detection, i.e. it will not draw a street name on top of a housing number.

Hope this helps,
-Arne

1: http://blog.geoserver.org/2009/01/25/geoserver-172-released/

Rubio Iglesias José Miguel wrote:

Hello,

I’m Jose Miguel Rubio from IGN (National Geographical Institute) from Spain and we are now thinking of GeoServer as a solution to improve our WMS of the CartoCiudad project (national and seamless database of addresses of Spain). Unfortunately I am not an expert in GeoServer and I have some questions that actually I cannot get solved by myself but I am sure you could help me.

Firstly, when I make a GetFeatureInfo request, it appears an attribute “FID” that does not exist in our Oracle DB. Could it be possible to hide this information?

I have read that a solution to hide attributes is to create a view in our DB, but I do not know if GeoServer admits views without ID (actually the primary key of the table). We are not interested to show neither ID nor FID in GetFeatureInfo responses. (1)

Another question regarding GetFeatureInfo is related to the name of the Featuretype. Could I change the name of the Featuretype instead of using the one from the DB view? In the Admin Tool there is a field called “Alias”, I am not sure if this is related with this issue, but it does not work anyway. (2)

Here is an image of an Openlayers client using GeoServer with our data:

1

2

The last question is related to the configuration of priorities when the different layers are drawn. In one layer we have the house numbers and in other one we have the street names. I have designed the corresponding SLD so at certain scales both layers are shown, and always appear a lot of house numbers and few street names. I have changed the font size of the labels but it only improved a little. Is there a way to reverse this situation? What I do not want is to get names and numbers overlapped, but I think street names are more important than house numbers and I would prefer to show those when there was a lot of information. Could it be related to the order in the WMS? Or to some vendor option of text symbolizer element in SLD?

I attach an example very illustrative: you can see a lot of house numbers but the street names are not shown; only when you are at a big scale they begin to appear.

Thank you very much.

Best regards,

José Miguel Rubio

-------------------------------------------------------------------------------*//*

*/José Miguel Rubio Igl/**/esias/*

*/Subdirección General de Aplicaciones Geográficas/*

*/Instituto Geográfico Nacional/*

*/C/General Ibáñez de Ibero, 3 28003 MADRID/*

*/Despacho: A 0002 Teléfono: 91 597 97 51/*

*/E-mail: jmrubio@anonymised.com <mailto:jmrubio@anonymised.com> /*

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

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
------------------------------------------------------------------------

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
  
--
Arne Kepp
OpenGeo - http://opengeo.org
Expert service straight from the developers

Arne Kepp wrote:

Hi Jose,

The fid is an internal reference that GeoServer uses. Ideally it should be of the form <feature type>.<primary key value>. If the primary key is not accessible then it's not really a meaningful thing.

Just to clarify. FID is something required by the WFS spec to publish. And gets reported in various WMS outputs as well. Interally GeoServer looks for a primary key on the table to generate the FID.

So if you really want to hide it from all services, creating a view (or changing the key structure of the table), is the best option. However if you only care about GetFeatureInfo then templates will work.

The alias field is meant for requests, so instead of asking for the layers=someprefix:some_very_confusing_acronym you can just ask for layers=roads , but I'm not sure that this will be reflected in the getfeatureinfo.

Please have a look at the following page, it explains how you can format the output and omit fields: http://geoserver.org/display/GEOSDOC/GetFeatureInfo+templates

I'm not an expert at the label rendering stuff, but I would recommend you try 1.7.2 (see [1]) with the new options, both curved labeling and wrapped labels should help in these cases. GeoServer does collision detection, i.e. it will not draw a street name on top of a housing number.

Hope this helps,
-Arne

1: http://blog.geoserver.org/2009/01/25/geoserver-172-released/

Rubio Iglesias José Miguel wrote:

Hello,

I’m Jose Miguel Rubio from IGN (National Geographical Institute) from Spain and we are now thinking of GeoServer as a solution to improve our WMS of the CartoCiudad project (national and seamless database of addresses of Spain). Unfortunately I am not an expert in GeoServer and I have some questions that actually I cannot get solved by myself but I am sure you could help me.

Firstly, when I make a GetFeatureInfo request, it appears an attribute “FID” that does not exist in our Oracle DB. Could it be possible to hide this information?

I have read that a solution to hide attributes is to create a view in our DB, but I do not know if GeoServer admits views without ID (actually the primary key of the table). We are not interested to show neither ID nor FID in GetFeatureInfo responses. (1)

Another question regarding GetFeatureInfo is related to the name of the Featuretype. Could I change the name of the Featuretype instead of using the one from the DB view? In the Admin Tool there is a field called “Alias”, I am not sure if this is related with this issue, but it does not work anyway. (2)

Here is an image of an Openlayers client using GeoServer with our data:

1

2

The last question is related to the configuration of priorities when the different layers are drawn. In one layer we have the house numbers and in other one we have the street names. I have designed the corresponding SLD so at certain scales both layers are shown, and always appear a lot of house numbers and few street names. I have changed the font size of the labels but it only improved a little. Is there a way to reverse this situation? What I do not want is to get names and numbers overlapped, but I think street names are more important than house numbers and I would prefer to show those when there was a lot of information. Could it be related to the order in the WMS? Or to some vendor option of text symbolizer element in SLD?

I attach an example very illustrative: you can see a lot of house numbers but the street names are not shown; only when you are at a big scale they begin to appear.

Thank you very much.

Best regards,

José Miguel Rubio

-------------------------------------------------------------------------------*//*

*/José Miguel Rubio Igl/**/esias/*

*/Subdirección General de Aplicaciones Geográficas/*

*/Instituto Geográfico Nacional/*

*/C/General Ibáñez de Ibero, 3 28003 MADRID/*

*/Despacho: A 0002 Teléfono: 91 597 97 51/*

*/E-mail: jmrubio@anonymised.com <mailto:jmrubio@anonymised.com> /*

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

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
------------------------------------------------------------------------

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
  
--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

Rubio Iglesias José Miguel wrote:

Firstly, when I make a GetFeatureInfo request, it appears an attribute “FID” that does not exist in our Oracle DB. Could it be possible to hide this information?

Use the templates or custom code as others have said, no matter what
a Feature will always have an identifier, based on a primary key or
just made up to make the WFS standard happy, there's no way to actually
remove, but as others said you can make up a template that just does
not display the FID.

Another question regarding GetFeatureInfo is related to the name of the Featuretype. Could I change the name of the Featuretype instead of using the one from the DB view? In the Admin Tool there is a field called “Alias”, I am not sure if this is related with this issue, but it does not work anyway. (2)

Alias is really a misnomer, when you set it, it's really the new name of
the layer, not an alternate way to call the layer. that is, it makes
the native name disappear completely and takes its place.

The last question is related to the configuration of priorities when the different layers are drawn. In one layer we have the house numbers and in other one we have the street names. I have designed the corresponding SLD so at certain scales both layers are shown, and always appear a lot of house numbers and few street names. I have changed the font size of the labels but it only improved a little. Is there a way to reverse this situation? What I do not want is to get names and numbers overlapped, but I think street names are more important than house numbers and I would prefer to show those when there was a lot of information. Could it be related to the order in the WMS? Or to some vendor option of text symbolizer element in SLD?

There are two ways to achieve this:
- flip the order so that strees get drawn before house numbers. Labels
   are drawn in the order the layer they come from appear, so lower
   layers always get their label drawn, the others fight with the
   space left free by them
- use the Priority SLD option to change the order in which the labels
   are drawn, see the documentation here:
   http://geoserver.org/display/GEOSDOC/LabelingOptions

Cheers
Andrea

Thank you very much to all, I will try out and I will inform you if GeoServer is finally going to be used in CartoCiudad project.

Best regards,

José Miguel Rubio

-----Mensaje original-----
De: Andrea Aime [mailto:aaime@anonymised.com]
Enviado el: viernes, 30 de enero de 2009 17:05
Para: Rubio Iglesias José Miguel
CC: geoserver-users@lists.sourceforge.net
Asunto: Re: [Geoserver-users] Some questions about GetFeatureInfo and priorities of layers in a WMS

Rubio Iglesias José Miguel wrote:

Firstly, when I make a GetFeatureInfo request, it appears an attribute
"FID" that does not exist in our Oracle DB. Could it be possible to hide
this information?

Use the templates or custom code as others have said, no matter what
a Feature will always have an identifier, based on a primary key or
just made up to make the WFS standard happy, there's no way to actually
remove, but as others said you can make up a template that just does
not display the FID.

Another question regarding GetFeatureInfo is related to the name of the
Featuretype. Could I change the name of the Featuretype instead of using
the one from the DB view? In the Admin Tool there is a field called
"Alias", I am not sure if this is related with this issue, but it does
not work anyway. (2)

Alias is really a misnomer, when you set it, it's really the new name of
the layer, not an alternate way to call the layer. that is, it makes
the native name disappear completely and takes its place.

The last question is related to the configuration of priorities when the
different layers are drawn. In one layer we have the house numbers and
in other one we have the street names. I have designed the corresponding
SLD so at certain scales both layers are shown, and always appear a lot
of house numbers and few street names. I have changed the font size of
the labels but it only improved a little. Is there a way to reverse this
situation? What I do not want is to get names and numbers overlapped,
but I think street names are more important than house numbers and I
would prefer to show those when there was a lot of information. Could it
be related to the order in the WMS? Or to some vendor option of text
symbolizer element in SLD?

There are two ways to achieve this:
- flip the order so that strees get drawn before house numbers. Labels
   are drawn in the order the layer they come from appear, so lower
   layers always get their label drawn, the others fight with the
   space left free by them
- use the Priority SLD option to change the order in which the labels
   are drawn, see the documentation here:
   http://geoserver.org/display/GEOSDOC/LabelingOptions

Cheers
Andrea