I’ve been doing some reading about how to create a datastore on the fly to write some dynamic feature data to. It seems like I can do this by creating a datastore programmatically with geotools, such as a shapefile, gml datastore or in-memory. I’m mostly looking for a quick way to get up and running and minimizing configuration for our app. I know a real spatial database is better, but that’s a real pain for development and demo purposes. If I can a datastore on the fly, do I have to manually go into the geoserver admin and add it? Can I add it on the fly to geoserver?
Thanks!
Ryan
Hi Ryan,
I'm not 100% clear on what you're trying to do. It sounds like you want
to do some (maybe hard-coded) configuration of a datastore in Java code
and then register your pre-configured datastore with Geoserver rather than
having to distribute your application with a list of instructions on
setting up Geoserver. If this is the case, you can look at this recent
discussion on the mailing list about packaging a configuration directory
with Geoserver:
http://sourceforge.net/mailarchive/forum.php?thread_name=4790C6A7.8040402%40meteo.fr&forum_name=geoserver-users.
If you have your data in a format like shapefiles that can be stored in
the data directory then this will allow you to ship the data along with
Geoserver in the .war file.
This solution wouldn't require any custom code (beyond the build option.)
You would just run a normal Geoserver instance, configure it as needed,
then copy the data directory to someplace that could be accessed when
building your custom .war file.
Hope this helps,
David Winslow
On Wed, January 23, 2008 9:58 pm, Ryan Moquin wrote:
I've been doing some reading about how to create a datastore on the fly
to write some dynamic feature data to. It seems like I can do this by
creating a datastore programmatically with geotools, such as a shapefile,
gml datastore or in-memory. I'm mostly looking for a quick way to get up
and running and minimizing configuration for our app. I know a real
spatial database is better, but that's a real pain for development and
demo purposes. If I can a datastore on the fly, do I have to manually go
into the geoserver admin and add it? Can I add it on the fly to
geoserver?
Thanks!
Ryan
!DSPAM:4040,4797fedc48132085621377!
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
!DSPAM:4040,4797fedc48132085621377!
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
!DSPAM:4040,4797fedc48132085621377!
Ryan Moquin ha scritto:
I've been doing some reading about how to create a datastore on the fly to write some dynamic feature data to. It seems like I can do this by creating a datastore programmatically with geotools, such as a shapefile, gml datastore or in-memory. I'm mostly looking for a quick way to get up and running and minimizing configuration for our app. I know a real spatial database is better, but that's a real pain for development and demo purposes. If I can a datastore on the fly, do I have to manually go into the geoserver admin and add it? Can I add it on the fly to geoserver?
You can, but the produce for doing so is ugly at best at the moment.
You have two options:
* modify the geoserver configuration files (not documented, but not
hard to understand either) and make a call to geoserver in order
to make it reload the configuratio (same way as a user would do) or
* mimick fully what a user would on the config interface as explained
here: http://docs.codehaus.org/display/GEOSDOC/Alternative+for+reloading+the+Geoserver+catalog
We'll eventually have a REST based API that one can call to interact
with the GeoServer configuration, but it's not clear when it'll be
available and stable at the moment.
Cheers
Andrea
If you need to do any sort of dynamic detection then preconfiguring geoserver
won't work for you. See Andrea's mail about programmatic configuration.
Unfortunately, this sort of thing isn't very well supported right now, but I
think he listed all of your options in his message.
-David Winslow
On Thursday 24 January 2008 09:09:21 you wrote:
That's pretty much what I want to do, in our application we will have a lot
of different sources we could pull from and so I was thinking maybe to
minimize maintenance of a geoserver distribution, I could generate a
shapefile and register it on the fly for each new dynamic data source that
is discovered (there is a way to extract basic feature items for each
source), otherwise I have to create a new shapefile manually each time and
add it. I thought I read that by creating a catalog with geotools, somehow
you could get geoserver to read that and add the datasources. The geotools
documentation seems to allude to this, but maybe I'm mistaken. I'm just
looking for any simplicity in configuration of our components as possible,
otherwise someone could spend 2 weeks configuring it before they could do
anything.
On Jan 23, 2008 11:29 PM, <dwinslow@anonymised.com> wrote:
> Hi Ryan,
>
> I'm not 100% clear on what you're trying to do. It sounds like you want
> to do some (maybe hard-coded) configuration of a datastore in Java code
> and then register your pre-configured datastore with Geoserver rather
> than having to distribute your application with a list of instructions on
> setting up Geoserver. If this is the case, you can look at this recent
> discussion on the mailing list about packaging a configuration directory
> with Geoserver:
>
> http://sourceforge.net/mailarchive/forum.php?thread_name=4790C6A7.8040402
>%40meteo.fr&forum_name=geoserver-users .
> If you have your data in a format like shapefiles that can be stored in
> the data directory then this will allow you to ship the data along with
> Geoserver in the .war file.
>
> This solution wouldn't require any custom code (beyond the build option.)
> You would just run a normal Geoserver instance, configure it as needed,
> then copy the data directory to someplace that could be accessed when
> building your custom .war file.
>
> Hope this helps,
> David Winslow
>
> On Wed, January 23, 2008 9:58 pm, Ryan Moquin wrote:
> > I've been doing some reading about how to create a datastore on the fly
> > to write some dynamic feature data to. It seems like I can do this by
> > creating a datastore programmatically with geotools, such as a
>
> shapefile,
>
> > gml datastore or in-memory. I'm mostly looking for a quick way to get
>
> up
>
> > and running and minimizing configuration for our app. I know a real
> > spatial database is better, but that's a real pain for development and
> > demo purposes. If I can a datastore on the fly, do I have to manually
>
> go
>
> > into the geoserver admin and add it? Can I add it on the fly to
> > geoserver?
> >
> > Thanks!
> > Ryan
>
> -------------------------------------------------------------------------
>
> > This SF.net email is sponsored by: Microsoft
> > Defy all challenges. Microsoft(R) Visual Studio 2008.
> > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> >
> >
> > !DSPAM:4040,4797fedc48132085621377!
> > _______________________________________________
> > Geoserver-users mailing list
> > Geoserver-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/geoserver-users
> >
> >
> >
> > !DSPAM:4040,4797fedc48132085621377!
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Geoserver-users mailing list
> Geoserver-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
!DSPAM:4040,47989c14219941431913854!