[Geoserver-users] multiple features from a single table

Hi

I am using geoserver to setup the layers to be rendered. I have a situation
where i have multiple layers that need to be rendered, all from a single
table differentiated by a discriminator column. Any ideas how I can create
my feature types in teh feature type editor in such a situation? Using views
is of course one option, but due to the sheer number of views that could
possibly be created this is possibly out of the question.

Any ideas/help will be appreciated

Thanks & Regards

Ajay Ravichandran
--
View this message in context: http://www.nabble.com/multiple-features-from-a-single-table-tp20691629p20691629.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

I think you need to check various appproaches, like adding rules to sld or using CQL filters.

Simone.

Eng. Simone Giannecchini
GeoSolutions S.A.S.
Owner - Software Engineer
Via Carignoni 51
55041 Camaiore (LU)
Italy

phone: +39 0584983027
fax: +39 0584983027
mob: +39 333 8128928

http://www.geo-solutions.it
http://simboss.blogspot.com/
http://www.linkedin.com/in/simonegiannecchini


On Wed, Nov 26, 2008 at 12:17 AM, ajayr <ajayr.email@anonymised.com> wrote:

Hi

I am using geoserver to setup the layers to be rendered. I have a situation
where i have multiple layers that need to be rendered, all from a single
table differentiated by a discriminator column. Any ideas how I can create
my feature types in teh feature type editor in such a situation? Using views
is of course one option, but due to the sheer number of views that could
possibly be created this is possibly out of the question.

Any ideas/help will be appreciated

Thanks & Regards

Ajay Ravichandran

View this message in context: http://www.nabble.com/multiple-features-from-a-single-table-tp20691629p20691629.html
Sent from the GeoServer - User mailing list archive at Nabble.com.


This SF.Net email is sponsored by the Moblin Your Move Developer’s challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/


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

Hi Simone

Yes using filters at the SLD level seems to be the best idea.

But I am also having problem within the geoserver admin tool itself. When i
try to create multiple layers from the same table, i.e. add a FeatureType in
geoserver admin, with the same name (because apparently geoserver
automatically takes the name as the database table name) but with different
alias, it shows up on the admin but does not persist in the data store. So
when i restart tomcat all the layers are gone and I have to create them from
scratch again

Any ideas about this

Thanks & Regards

Ajay Ravichandran

Simone Giannecchini wrote:

I think you need to check various appproaches, like adding rules to sld or
using CQL filters.

Simone.
-------------------------------------------------------
Eng. Simone Giannecchini
GeoSolutions S.A.S.
Owner - Software Engineer
Via Carignoni 51
55041 Camaiore (LU)
Italy

phone: +39 0584983027
fax: +39 0584983027
mob: +39 333 8128928

http://www.geo-solutions.it
http://simboss.blogspot.com/
http://www.linkedin.com/in/simonegiannecchini

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

On Wed, Nov 26, 2008 at 12:17 AM, ajayr <ajayr.email@anonymised.com> wrote:

Hi

I am using geoserver to setup the layers to be rendered. I have a
situation
where i have multiple layers that need to be rendered, all from a single
table differentiated by a discriminator column. Any ideas how I can
create
my feature types in teh feature type editor in such a situation? Using
views
is of course one option, but due to the sheer number of views that could
possibly be created this is possibly out of the question.

Any ideas/help will be appreciated

Thanks & Regards

Ajay Ravichandran
--
View this message in context:
http://www.nabble.com/multiple-features-from-a-single-table-tp20691629p20691629.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's
challenge
Build the coolest Linux based applications with Moblin SDK & win great
prizes
Grand prize is a trip for two to an Open Source event anywhere in the
world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's
challenge
Build the coolest Linux based applications with Moblin SDK & win great
prizes
Grand prize is a trip for two to an Open Source event anywhere in the
world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
View this message in context: http://www.nabble.com/multiple-features-from-a-single-table-tp20691629p20723106.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Hi Ajay,

Assuming the value of the discriminator column has n different values:

1. Create an SLD which n rules in it. Each rule specifies a filter which matches a particular value of the distriminator column.

2. Add the table (i assume it is a table) n times to geoserver as feature types, each time setting the above SLD style as the default style.

Hope that helps. In terms of efficiency views would be more efficient. Also (and I might be wrong here) creating n SLD's instead of 1 will probably be faster too.

-Justin

ajayr wrote:

Hi

I am using geoserver to setup the layers to be rendered. I have a situation
where i have multiple layers that need to be rendered, all from a single
table differentiated by a discriminator column. Any ideas how I can create
my feature types in teh feature type editor in such a situation? Using views
is of course one option, but due to the sheer number of views that could
possibly be created this is possibly out of the question.

Any ideas/help will be appreciated

Thanks & Regards

Ajay Ravichandran

--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

Hi Justin

Yes I have done pretty much the same thing - an individual SLD for each layer with a Filter, I create FeatureType - one for each layer with the same table name, but different aliases.

But something weird happens with geoserver. I am able to do this and “Apply” in the geoserver admin. But when i try to persist it using “Save”, it does not persist all the layers, so essentially i have all the layers, as long as my geoserver is up and running, but when it goes down and has to be restarted, all my layers are gone and i have to recreate them all from scratch.

The issue that I could figure out is that when geoserver persists the featureTypes, it uses the name as the key value, and the name will always be the “table name”, so essentially there can be only one entry that will be persisted with the “table name” key. So right now the only way out for me is to modify geoserver code.

Any ideas??

Thanks & Regards

Ajay Ravichandran

On Thu, Nov 27, 2008 at 6:33 PM, Justin Deoliveira <jdeolive@anonymised.com> wrote:

Hi Ajay,

Assuming the value of the discriminator column has n different values:

  1. Create an SLD which n rules in it. Each rule specifies a filter which matches a particular value of the distriminator column.

  2. Add the table (i assume it is a table) n times to geoserver as feature types, each time setting the above SLD style as the default style.

Hope that helps. In terms of efficiency views would be more efficient. Also (and I might be wrong here) creating n SLD’s instead of 1 will probably be faster too.

-Justin

ajayr wrote:

Hi
I am using geoserver to setup the layers to be rendered. I have a situation
where i have multiple layers that need to be rendered, all from a single
table differentiated by a discriminator column. Any ideas how I can create
my feature types in teh feature type editor in such a situation? Using views
is of course one option, but due to the sheer number of views that could
possibly be created this is possibly out of the question.

Any ideas/help will be appreciated

Thanks & Regards

Ajay Ravichandran


Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

This seems to me to be a very good case for the use of views. You would be able to keep the features in a single table (as befits their status as features of a common type) but be able to distinguish them on the basis of your discriminator column, and you'd be letting the database do that work. It's probably going to be faster than GeoServer, as Justin says.

Is there a particular reason you require to do this in the symbolization layer?

---
A. Soroka ; Digital Scholarship Services R & D ; the University of Virginia Library

On Dec 1, 2008, at 1:04 PM, AJ R wrote:

Hi Justin

Yes I have done pretty much the same thing - an individual SLD for each layer with a Filter, I create FeatureType - one for each layer with the same table name, but different aliases.

But something weird happens with geoserver. I am able to do this and "Apply" in the geoserver admin. But when i try to persist it using "Save", it does not persist all the layers, so essentially i have all the layers, as long as my geoserver is up and running, but when it goes down and has to be restarted, all my layers are gone and i have to recreate them all from scratch.

The issue that I could figure out is that when geoserver persists the featureTypes, it uses the name as the key value, and the name will always be the "table name", so essentially there can be only one entry that will be persisted with the "table name" key. So right now the only way out for me is to modify geoserver code.

Any ideas??

Thanks & Regards

Ajay Ravichandran

On Thu, Nov 27, 2008 at 6:33 PM, Justin Deoliveira <jdeolive@anonymised.com> wrote:
Hi Ajay,

Assuming the value of the discriminator column has n different values:

1. Create an SLD which n rules in it. Each rule specifies a filter which matches a particular value of the distriminator column.

2. Add the table (i assume it is a table) n times to geoserver as feature types, each time setting the above SLD style as the default style.

Hope that helps. In terms of efficiency views would be more efficient. Also (and I might be wrong here) creating n SLD's instead of 1 will probably be faster too.

-Justin

ajayr wrote:
Hi
I am using geoserver to setup the layers to be rendered. I have a situation
where i have multiple layers that need to be rendered, all from a single
table differentiated by a discriminator column. Any ideas how I can create
my feature types in teh feature type editor in such a situation? Using views
is of course one option, but due to the sheer number of views that could
possibly be created this is possibly out of the question.

Any ideas/help will be appreciated

Thanks & Regards

Ajay Ravichandran

--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

AJ R ha scritto:

Hi Justin

Yes I have done pretty much the same thing - an individual SLD for each layer with a Filter, I create FeatureType - one for each layer with the same table name, but different aliases.

But something weird happens with geoserver. I am able to do this and "Apply" in the geoserver admin. But when i try to persist it using "Save", it does not persist all the layers, so essentially i have all the layers, as long as my geoserver is up and running, but when it goes down and has to be restarted, all my layers are gone and i have to recreate them all from scratch.

The issue that I could figure out is that when geoserver persists the featureTypes, it uses the name as the key value, and the name will always be the "table name", so essentially there can be only one entry that will be persisted with the "table name" key. So right now the only way out for me is to modify geoserver code.

Mumble, I've tried to reproduce this one with the topp:states shapefile,
creating states2 and states3, saved and they survived a restart.
Then loaded the shapefile in postgis and added two more feature types
whose native name is states as pgstates1, pgstates2, saved, restarted.
All of them survived the restart.

Maybe the bug was fixed between 1.7.0 release and today?
Can you double check with a nightly build?
Here: http://gridlock.openplans.org/geoserver/1.7.x/

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

Hi Andrea

Thanks for the reply. Yes apparently this is a bug from the 1.6.5 version. I upgraded to 1.7.0a and everything works great. I’ve been having lots of problems with the ImagePyramid Plugin in 1.7 which was the reason i shifted to 1.6.5, But I guess I will now have to figure out how to get the ImagePyramidPlugin working with 1.7

Thanks for the help

Regards

Ajay Ravichandran

On Tue, Dec 2, 2008 at 11:54 AM, Andrea Aime <aaime@anonymised.com> wrote:

AJ R ha scritto:

Hi Justin

Yes I have done pretty much the same thing - an individual SLD for each layer with a Filter, I create FeatureType - one for each layer with the same table name, but different aliases.

But something weird happens with geoserver. I am able to do this and “Apply” in the geoserver admin. But when i try to persist it using “Save”, it does not persist all the layers, so essentially i have all the layers, as long as my geoserver is up and running, but when it goes down and has to be restarted, all my layers are gone and i have to recreate them all from scratch.

The issue that I could figure out is that when geoserver persists the featureTypes, it uses the name as the key value, and the name will always be the “table name”, so essentially there can be only one entry that will be persisted with the “table name” key. So right now the only way out for me is to modify geoserver code.

Mumble, I’ve tried to reproduce this one with the topp:states shapefile,
creating states2 and states3, saved and they survived a restart.
Then loaded the shapefile in postgis and added two more feature types
whose native name is states as pgstates1, pgstates2, saved, restarted.
All of them survived the restart.

Maybe the bug was fixed between 1.7.0 release and today?
Can you double check with a nightly build?
Here: http://gridlock.openplans.org/geoserver/1.7.x/

Cheers
Andrea


Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.