RE: using postgres-views as feature-type in geo server

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

RE: using postgres-views as feature-type in geo server

P.Rizzi Ag.Mobilità Ambiente
To use views they must have a row inside geometry_colums, and you already
did that.
They also must (I'm not sure, but I always have to do that) have an oid
column, to make the FIDMapper happy. So the must always be defined like:
CREATE OR REPLACE VIEW fooview AS
 SELECT <any appropriate field> AS oid, etc, etc  
FROM footable;

So you must explicitely add a column with name oid.

For the translator error, I don't know if that's your case, but there's a
little bug in GeoTools/GeoServer that prevents from using boolean fields. If
you have boolean columns in your tables or views, you'll get that error. See
JIRA: http://jira.codehaus.org/browse/GEOS-325

Bye
Paolo Rizzi
 

-----Original Message-----
From: David Dabney
To: Henriksen Jonas F
Cc: [hidden email]
Sent: 24/06/2005 17.06
Subject: Re: [Geoserver-users] using postgres-views as feature-type in
geoserver

Jonas,

I am in the same place you are in regard to this problem.  It would be
very nice for me to be able to use my views.  I'm new to GeoServer, but
went through the archives yesterday and was able to get the default
geometry column to be detected by manually adding a row to the
geometry_columns table for my view.  This worked and the view shows up
in WFS:GetCapabilities.

 However, I get errors when I try to do a GetFeature request.  I'm
getting a translator error.  If anyone has an idea about this it would
be much appreciated.  In some post something about naming one of the
fields gid was mentioned.

-Dave

Henriksen, Jonas F wrote:

>Hi,
>
>I have installed geoserver 1.3.0 RC1 which I read in the changelog
should allow the use of postgres-views as feature-types. This is a very
handy feature. However, I cant get geoserver to detect the default
geometry column. Any suggestion how to fix this?

>
>my view:
>
>CREATE OR REPLACE VIEW distview AS
> SELECT d.oid AS oid,
>d.gid AS gid,
>d.id AS id,
>transform(d.the_geom, 4326) AS the_geom,
>time_interval AS time,
>sp.nor_common_name AS name,
>st.name AS stage
>FROM distribution d, species sp, stage st
>WHERE st.stage=d.stage AND sp.species=d.species ;
>
>regards Jonas:))))
>
>--
>Jonas F Henriksen
>Institute of Marine Research
>Norsk Marint Datasenter
>PO Box 1870 Nordnes
>5817 Bergen
>Norway
>
>Phone: +47 55238441
>
>
>
>
>
>-------------------------------------------------------
>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. <a href="http://ads.osdn.com/?ad_idt77&alloc_id492&op=click">http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
>_______________________________________________
>Geoserver-users mailing list
>[hidden email]
>https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
>  
>

--
~~~~~~~~~~~~~~~~~~~~~~~
David Dabney
OHH Programmer/Database Specialist
NOAA Hollings Marine Lab/JHT
331 Fort Johnson Rd
Charleston, SC 29412
843.762.8984
843.762.8811 receptionist
843.762.8737 fax
[hidden email]



-------------------------------------------------------
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-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users


-------------------------------------------------------
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-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: using postgres-views as feature-type in geo server

David Dabney
I must not have used AS oid, but gid instead.  It works now.  Thanks!



P.Rizzi Ag.Mobilità Ambiente wrote:

>To use views they must have a row inside geometry_colums, and you already
>did that.
>They also must (I'm not sure, but I always have to do that) have an oid
>column, to make the FIDMapper happy. So the must always be defined like:
>CREATE OR REPLACE VIEW fooview AS
> SELECT <any appropriate field> AS oid, etc, etc  
>FROM footable;
>
>So you must explicitely add a column with name oid.
>
>For the translator error, I don't know if that's your case, but there's a
>little bug in GeoTools/GeoServer that prevents from using boolean fields. If
>you have boolean columns in your tables or views, you'll get that error. See
>JIRA: http://jira.codehaus.org/browse/GEOS-325
>
>Bye
>Paolo Rizzi
>
>
>-----Original Message-----
>From: David Dabney
>To: Henriksen Jonas F
>Cc: [hidden email]
>Sent: 24/06/2005 17.06
>Subject: Re: [Geoserver-users] using postgres-views as feature-type in
>geoserver
>
>Jonas,
>
>I am in the same place you are in regard to this problem.  It would be
>very nice for me to be able to use my views.  I'm new to GeoServer, but
>went through the archives yesterday and was able to get the default
>geometry column to be detected by manually adding a row to the
>geometry_columns table for my view.  This worked and the view shows up
>in WFS:GetCapabilities.
>
> However, I get errors when I try to do a GetFeature request.  I'm
>getting a translator error.  If anyone has an idea about this it would
>be much appreciated.  In some post something about naming one of the
>fields gid was mentioned.
>
>-Dave
>
>Henriksen, Jonas F wrote:
>
>  
>
>>Hi,
>>
>>I have installed geoserver 1.3.0 RC1 which I read in the changelog
>>    
>>
>should allow the use of postgres-views as feature-types. This is a very
>handy feature. However, I cant get geoserver to detect the default
>geometry column. Any suggestion how to fix this?
>  
>
>>my view:
>>
>>CREATE OR REPLACE VIEW distview AS
>>SELECT d.oid AS oid,
>>d.gid AS gid,
>>d.id AS id,
>>transform(d.the_geom, 4326) AS the_geom,
>>time_interval AS time,
>>sp.nor_common_name AS name,
>>st.name AS stage
>>    
>>
>>FROM distribution d, species sp, stage st
>  
>
>>WHERE st.stage=d.stage AND sp.species=d.species ;
>>
>>regards Jonas:))))
>>
>>--
>>Jonas F Henriksen
>>Institute of Marine Research
>>Norsk Marint Datasenter
>>PO Box 1870 Nordnes
>>5817 Bergen
>>Norway
>>
>>Phone: +47 55238441
>>
>>
>>
>>
>>
>>-------------------------------------------------------
>>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. <a href="http://ads.osdn.com/?ad_idt77&alloc_id492&op=click">http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
>>_______________________________________________
>>Geoserver-users mailing list
>>[hidden email]
>>https://lists.sourceforge.net/lists/listinfo/geoserver-users
>>
>>
>>
>>    
>>
>
>  
>

--
~~~~~~~~~~~~~~~~~~~~~~~
David Dabney
OHH Programmer/Database Specialist
NOAA Hollings Marine Lab/JHT
331 Fort Johnson Rd
Charleston, SC 29412
843.762.8984
843.762.8811 receptionist
843.762.8737 fax
[hidden email]



-------------------------------------------------------
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-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users