[Geoserver-devel] Dynamic create featureType for each session

Hi,
   I have a requirement to create a dynamic featureType for each http
session. Now the geoserver can only create a featureType from a postGis
table via the admin UI.I'm just wondering if there are any ways I can
create a featureType inside a java servlet from a sql select statement
result. I know I may use geotools to create a new featureType. But this
method seems cannot change the cooresponding config file in geoserver.
Any sugegstions to me?
  Thanks
  Rong

Hi,
   I have a requirement to create a dynamic featureType for each http
session. Now the geoserver can only create a featureType from a postGis
table via the admin UI.I'm just wondering if there are any ways I can
create a featureType inside a java servlet from a sql select statement
result. I know I may use geotools to create a new featureType. But this
method seems cannot change the cooresponding config file in geoserver.
Any sugegstions to me?

I don't quite understand 'for each http session'? Creating a featureType
from a sql select statement result is more like a dynamic 'view'. Social
Change Online has done some work trying out things like this, and Gabriel
is going to be working the next couple months to get some of their changes
in geoserver 'for real'. Right now your best option is to just create a
view in PostGIS, and use that as a featureType (having a field named 'oid'
helps, or making a primary key on the view, and you'll need to register
the geometry in the geometry_columns table). If you're talking something
more dynamic I'd like to hear more specifics about your use case. We
probably don't support it, but we could try to in the future.

best regards,

Chris

  Thanks
  Rong

-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

--

Hi, Chris,
  My usecase is as below. We are building a yield tracker website based on
geoserver. The farmer can access this website and select a field and
submit a request for predicting the yield of products planted in that
field. We want build a yield layer over the field geograpgic map with
color for different yield value.We have a legacy program to get the UTM
coordinates of the selcted field and other related information input and
return the yield value for each points inside the selected field by
farmer. Now I'm thinking about to build yield layer for each pionts and
display this layer over the filed gis map. When each farmer send a yield
prediction request for the selected layer, there is a return result from
the legacy program and we need generate a dynamic yield layer for the
select field.At the same time, another farmer will select another field
and send another prediction request and get another yield layer of his
selected field. All these are dynamic. I also think that we can create a
view for each yield prediction request. In this case, we also need
create a dynamic featureType for each cooresponding prediction request
and return the right wms getmap url with the generated layer name to the
client. If you still have any questions about this,PLS let me know.
  I'm think of creating the featureType from the dynamic view on the fly
using the admin interface inside a java program. Is this feasible?
  Thank you very much for any suggestions
  Best,

Hi,
   I have a requirement to create a dynamic featureType for each http
session. Now the geoserver can only create a featureType from a postGis
table via the admin UI.I'm just wondering if there are any ways I can
create a featureType inside a java servlet from a sql select statement
result. I know I may use geotools to create a new featureType. But this
method seems cannot change the cooresponding config file in geoserver.
Any sugegstions to me?

I don't quite understand 'for each http session'? Creating a featureType
from a sql select statement result is more like a dynamic 'view'. Social
Change Online has done some work trying out things like this, and Gabriel
is going to be working the next couple months to get some of their changes
in geoserver 'for real'. Right now your best option is to just create a
view in PostGIS, and use that as a featureType (having a field named 'oid'
helps, or making a primary key on the view, and you'll need to register
the geometry in the geometry_columns table). If you're talking something
more dynamic I'd like to hear more specifics about your use case. We
probably don't support it, but we could try to in the future.

best regards,

Chris

  Thanks
  Rong

-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

--

Thanks for your suggestions. But I still have some questions as below:

Rather than create a new featureType for each prediction, I'd think it
would be easier to create a static featureType with an attribute that
identified the prediction and then just select the features which have
that
value.

How can I select the festures with the points inside the selected field
and use the static featureType with an attribute to create a different
layer for different prediction request?

Or are the attributes (types, not values) different for each
prediction?

Here is a simple version of the table structure:
oid:serial | plant_categories: int | the_yield:int| the_ponit:point |
plant_date : date | the_geom:geometry

each UTM point has a record in this table.I just need select the points
with in a selected field and with the right plant_categories and right
plant_date for the repdiction request.

At 04:33 PM 6/27/2005, you wrote:

Hi, Chris,
  My usecase is as below. We are building a yield tracker website based
on
geoserver. The farmer can access this website and select a field and
submit a request for predicting the yield of products planted in that
field. We want build a yield layer over the field geograpgic map with
color for different yield value.We have a legacy program to get the UTM
coordinates of the selcted field and other related information input and
return the yield value for each points inside the selected field by
farmer. Now I'm thinking about to build yield layer for each pionts and
display this layer over the filed gis map. When each farmer send a yield
prediction request for the selected layer, there is a return result from
the legacy program and we need generate a dynamic yield layer for the
select field.At the same time, another farmer will select another field
and send another prediction request and get another yield layer of his
selected field. All these are dynamic. I also think that we can create a
view for each yield prediction request. In this case, we also need
create a dynamic featureType for each cooresponding prediction request
and return the right wms getmap url with the generated layer name to the
client. If you still have any questions about this,PLS let me know.
  I'm think of creating the featureType from the dynamic view on the fly
using the admin interface inside a java program. Is this feasible?
  Thank you very much for any suggestions
  Best,

>> Hi,
>> I have a requirement to create a dynamic featureType for each http
>> session. Now the geoserver can only create a featureType from a
postGis
>> table via the admin UI.I'm just wondering if there are any ways I can
>> create a featureType inside a java servlet from a sql select
statement
>> result. I know I may use geotools to create a new featureType. But
this
>> method seems cannot change the cooresponding config file in
geoserver.
>> Any sugegstions to me?
> I don't quite understand 'for each http session'? Creating a
featureType
> from a sql select statement result is more like a dynamic 'view'.
Social
> Change Online has done some work trying out things like this, and
Gabriel
> is going to be working the next couple months to get some of their
changes
> in geoserver 'for real'. Right now your best option is to just create
a
> view in PostGIS, and use that as a featureType (having a field named
'oid'
> helps, or making a primary key on the view, and you'll need to
register
> the geometry in the geometry_columns table). If you're talking
something
> more dynamic I'd like to hear more specifics about your use case. We
> probably don't support it, but we could try to in the future.
>
> best regards,
>
> Chris
>
>
>> Thanks
>> Rong
>>
>>
>> -------------------------------------------------------
>> SF.Net email is sponsored by: Discover Easy Linux Migration
Strategies
>> from IBM. Find simple to follow Roadmaps, straightforward articles,
>> informative Webcasts and more! Get everything you need to get up to
>> speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
>> _______________________________________________
>> Geoserver-devel mailing list
>> Geoserver-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/geoserver-devel
>>
>
> --
>
>

-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&opick
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

hi,

it seems to me that you are not creating new feature _types_ but new _instances_, and the current mapping of a result set to a feature type is too restrictive.

We have a project underway, as Chris said, to decouple the result set from a single table/view and allow it to be mapped to an arbitrary output. I think this could be used fairly easily against a defined function to achieve this sort of outcome.

(from later emails I see that you probably just need to create the correct query filter). Only quaestion is why the data structure appears to have two geometries - this is OK in GML world, not sure if geoserver will handle it well though. The real issue, like that of featuretypes versus instances is one of transparency: the_point and the_geom tell the user nothing about the semantics of the attribute, but merely reflect and duplicate information already available in the GML:geometry enclosed in these attributes.

Best to use pre-defined semantics such as gml:pos or gml:envelope or make your own up _ONLY IF THERE IS NO EQUIVALENT AVAILABLE!!!_ - such as myns:nearestPostOfficeLocation

the ability to actually use gml predefined semantics might require the schema output mapping technology we are putting into the product, so in the meantime you could use myns:pos and declare it to be equal via a XML schema substitution group. If you are not going to expose your "featureType" to external parties these issues may not be significant, but they lie at the root of creating stable interoperable solutions across enterprise boundaries.

Rob Atkinson

rong@anonymised.com wrote:

Hi, Chris,
My usecase is as below. We are building a yield tracker website based on
geoserver. The farmer can access this website and select a field and
submit a request for predicting the yield of products planted in that
field. We want build a yield layer over the field geograpgic map with
color for different yield value.We have a legacy program to get the UTM
coordinates of the selcted field and other related information input and
return the yield value for each points inside the selected field by
farmer. Now I'm thinking about to build yield layer for each pionts and
display this layer over the filed gis map. When each farmer send a yield
prediction request for the selected layer, there is a return result from
the legacy program and we need generate a dynamic yield layer for the
select field.At the same time, another farmer will select another field
and send another prediction request and get another yield layer of his
selected field. All these are dynamic. I also think that we can create a
view for each yield prediction request. In this case, we also need
create a dynamic featureType for each cooresponding prediction request
and return the right wms getmap url with the generated layer name to the
client. If you still have any questions about this,PLS let me know.
I'm think of creating the featureType from the dynamic view on the fly
using the admin interface inside a java program. Is this feasible?
Thank you very much for any suggestions
Best,

Hi,
  I have a requirement to create a dynamic featureType for each http
session. Now the geoserver can only create a featureType from a postGis
table via the admin UI.I'm just wondering if there are any ways I can
create a featureType inside a java servlet from a sql select statement
result. I know I may use geotools to create a new featureType. But this
method seems cannot change the cooresponding config file in geoserver.
Any sugegstions to me?
     

I don't quite understand 'for each http session'? Creating a featureType
from a sql select statement result is more like a dynamic 'view'. Social
Change Online has done some work trying out things like this, and Gabriel
is going to be working the next couple months to get some of their changes
in geoserver 'for real'. Right now your best option is to just create a
view in PostGIS, and use that as a featureType (having a field named 'oid'
helps, or making a primary key on the view, and you'll need to register
the geometry in the geometry_columns table). If you're talking something
more dynamic I'd like to hear more specifics about your use case. We
probably don't support it, but we could try to in the future.

best regards,

Chris

Thanks
Rong

-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

--

-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&opÌk
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Quoting rong@anonymised.com:

Hi, Chris,
  My usecase is as below. We are building a yield tracker website
based on
geoserver. The farmer can access this website and select a field and
submit a request for predicting the yield of products planted in that
field. We want build a yield layer over the field geograpgic map with
color for different yield value.We have a legacy program to get the
UTM
coordinates of the selcted field and other related information input
and
return the yield value for each points inside the selected field by
farmer. Now I'm thinking about to build yield layer for each pionts
and
display this layer over the filed gis map. When each farmer send a
yield
prediction request for the selected layer, there is a return result
from
the legacy program and we need generate a dynamic yield layer for the
select field.At the same time, another farmer will select another
field
and send another prediction request and get another yield layer of
his
selected field. All these are dynamic. I also think that we can
create a
view for each yield prediction request. In this case, we also need
create a dynamic featureType for each cooresponding prediction
request
and return the right wms getmap url with the generated layer name to
the
client. If you still have any questions about this,PLS let me know.
  I'm think of creating the featureType from the dynamic view on the
fly
using the admin interface inside a java program. Is this feasible?

Yes, this is definitely feasible, and I think the way to go now, before
we get Rob's improvements in. See:
http://docs.codehaus.org/display/GEOSDOC/Alternative+for+reloading+the+Geoserver+catalog
for how to force the reload from code. And I think the way these guys
did is to just make a new config xml file. The other possibility is
working with the DTO objects directly - they hold the config, and you
can just modify and reload with them.

best regards,

Chris

  Thank you very much for any suggestions
  Best,

>> Hi,
>> I have a requirement to create a dynamic featureType for each
http
>> session. Now the geoserver can only create a featureType from a
postGis
>> table via the admin UI.I'm just wondering if there are any ways I
can
>> create a featureType inside a java servlet from a sql select
statement
>> result. I know I may use geotools to create a new featureType. But
this
>> method seems cannot change the cooresponding config file in
geoserver.
>> Any sugegstions to me?
> I don't quite understand 'for each http session'? Creating a
featureType
> from a sql select statement result is more like a dynamic 'view'.
Social
> Change Online has done some work trying out things like this, and
Gabriel
> is going to be working the next couple months to get some of their
changes
> in geoserver 'for real'. Right now your best option is to just
create a
> view in PostGIS, and use that as a featureType (having a field
named 'oid'
> helps, or making a primary key on the view, and you'll need to
register
> the geometry in the geometry_columns table). If you're talking
something
> more dynamic I'd like to hear more specifics about your use case.
We
> probably don't support it, but we could try to in the future.
>
> best regards,
>
> Chris
>
>
>> Thanks
>> Rong
>>
>>
>> -------------------------------------------------------
>> SF.Net email is sponsored by: Discover Easy Linux Migration
Strategies
>> from IBM. Find simple to follow Roadmaps, straightforward
articles,
>> informative Webcasts and more! Get everything you need to get up
to
>> speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
>> _______________________________________________
>> Geoserver-devel mailing list
>> Geoserver-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/geoserver-devel
>>
>
> --
>
>

-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration
Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

----------------------------------------------------------
This mail sent through IMP: https://webmail.limegroup.com/

Hi, Rob and Chris,
  Thank you very much for your suggestions. Like Rob said, I just realized
that I only need to create new feature instance dynamically instead of
create new featureType dynamically. I think I can use the filter query
in the SLD file for each http request session. So each prediction
requestion will come with SLD file with the right filter query for the
slected field. Can the geoserver(wms) generate the map layer from
different filter query and the same featureType for different prediction
reuqests? I assume it can. I'll test it.
  For the two geometries in the table, i just use the PostgresSQL point
types but not the PostGIS geometry type for "the_point". I keep this
information redundency just for performance concern. The yield value is
generated by other legacy application which very slow. I'm thinking
about to cache the yield value in the database. In the future, if a
prediction request come, I'll check the DB first see if there has a
yield value for the selected field. If there has, just get it from DB.
And I know that the performance of the geometry function from PostGIS is
not good. So I just keep this PostgresSQL point type for performance
concern.
  Thanks again.
  Rong.

hi,

it seems to me that you are not creating new feature _types_ but new
_instances_, and the current mapping of a result set to a feature type
is too restrictive.

We have a project underway, as Chris said, to decouple the result set
from a single table/view and allow it to be mapped to an arbitrary
output. I think this could be used fairly easily against a defined
function to achieve this sort of outcome.

(from later emails I see that you probably just need to create the
correct query filter). Only quaestion is why the data structure appears
to have two geometries - this is OK in GML world, not sure if geoserver
will handle it well though. The real issue, like that of featuretypes
versus instances is one of transparency: the_point and the_geom tell the
user nothing about the semantics of the attribute, but merely reflect
and duplicate information already available in the GML:geometry enclosed
in these attributes.

Best to use pre-defined semantics such as gml:pos or gml:envelope or
make your own up _ONLY IF THERE IS NO EQUIVALENT AVAILABLE!!!_ - such as
myns:nearestPostOfficeLocation

the ability to actually use gml predefined semantics might require the
schema output mapping technology we are putting into the product, so in
the meantime you could use myns:pos and declare it to be equal via a XML
schema substitution group. If you are not going to expose your
"featureType" to external parties these issues may not be significant,
but they lie at the root of creating stable interoperable solutions
across enterprise boundaries.

Rob Atkinson

rong@anonymised.com wrote:

Hi, Chris,
My usecase is as below. We are building a yield tracker website based
on
geoserver. The farmer can access this website and select a field and
submit a request for predicting the yield of products planted in that
field. We want build a yield layer over the field geograpgic map with
color for different yield value.We have a legacy program to get the UTM
coordinates of the selcted field and other related information input and
return the yield value for each points inside the selected field by
farmer. Now I'm thinking about to build yield layer for each pionts and
display this layer over the filed gis map. When each farmer send a yield
prediction request for the selected layer, there is a return result from
the legacy program and we need generate a dynamic yield layer for the
select field.At the same time, another farmer will select another field
and send another prediction request and get another yield layer of his
selected field. All these are dynamic. I also think that we can create a
view for each yield prediction request. In this case, we also need
create a dynamic featureType for each cooresponding prediction request
and return the right wms getmap url with the generated layer name to the
client. If you still have any questions about this,PLS let me know.
I'm think of creating the featureType from the dynamic view on the fly
using the admin interface inside a java program. Is this feasible?
Thank you very much for any suggestions
Best,

Hi,
  I have a requirement to create a dynamic featureType for each http
session. Now the geoserver can only create a featureType from a postGis
table via the admin UI.I'm just wondering if there are any ways I can
create a featureType inside a java servlet from a sql select statement
result. I know I may use geotools to create a new featureType. But this
method seems cannot change the cooresponding config file in geoserver.
Any sugegstions to me?

I don't quite understand 'for each http session'? Creating a
featureType
from a sql select statement result is more like a dynamic 'view'.
Social
Change Online has done some work trying out things like this, and
Gabriel
is going to be working the next couple months to get some of their
changes
in geoserver 'for real'. Right now your best option is to just create a
view in PostGIS, and use that as a featureType (having a field named
'oid'
helps, or making a primary key on the view, and you'll need to register
the geometry in the geometry_columns table). If you're talking
something
more dynamic I'd like to hear more specifics about your use case. We
probably don't support it, but we could try to in the future.

best regards,

Chris

Thanks
Rong

-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

--

-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&opÌk
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel