I'm using 1.5.4. I have created a simple table with a geometry column in
postgis, but when I try to configure a featuretype, one of the columns
(location_id) does not appear. No errors appear (at least that I have
noticed). I can view the OpenLayers preview of the featuretype, and it
appears to work fine except location_id column is missing.
Other info... when I use uDig to browse the dataset the location_id columns
appears fine.
Here is the postgis table definition:
CREATE TABLE t_location
(
location_id int4 NOT NULL,
sitename varchar(50),
source_desc varchar(254),
geom geometry,
CONSTRAINT t_location_pk PRIMARY KEY (location_id),
CONSTRAINT enforce_dims_geom CHECK (ndims(geom) = 2),
CONSTRAINT enforce_geotype_geom CHECK (geometrytype(geom) = 'POINT'::text
OR geom IS NULL),
CONSTRAINT enforce_srid_geom CHECK (srid(geom) = 4326)
)
WITHOUT OIDS;
However, when I am creating a new feature type, the location_id doesn't
appear.
Schema Base:
sitename: string nillable:true min:0 max:1
source_desc: string nillable:true min:0 max:1
geom: pointProperty nillable:true min:0 max:1
The log file doesn't seem to report anything that looks interesting.
Any ideas on what's causing this?
- Tyler
--
View this message in context: http://www.nabble.com/missing-PostGIS-column-when-creating-FeatureType-tf4852487.html#a13884818
Sent from the GeoServer - User mailing list archive at Nabble.com.
Hi Tyler,
This is occurring because location_id is the primary key of the table.
By default GeoServer will not publish primary key attributes as regular
feature attributes, so that they are never modified.
There is an option in the postgis datastore to return primary attributes
as normal attributes, but i don't think you can set if from geoserver afaik.
Possible workarounds are turning oid's on (this may cause the postgis
fid mapper to chose oids and ignore the primary key, not 100% sure about
that will work though). Or choose a different column as the primary key.
-Justin
Tyler Erickson wrote:
I'm using 1.5.4. I have created a simple table with a geometry column in
postgis, but when I try to configure a featuretype, one of the columns
(location_id) does not appear. No errors appear (at least that I have
noticed). I can view the OpenLayers preview of the featuretype, and it
appears to work fine except location_id column is missing.
Other info... when I use uDig to browse the dataset the location_id columns
appears fine.
Here is the postgis table definition:
CREATE TABLE t_location
(
location_id int4 NOT NULL,
sitename varchar(50),
source_desc varchar(254),
geom geometry,
CONSTRAINT t_location_pk PRIMARY KEY (location_id),
CONSTRAINT enforce_dims_geom CHECK (ndims(geom) = 2),
CONSTRAINT enforce_geotype_geom CHECK (geometrytype(geom) = 'POINT'::text
OR geom IS NULL),
CONSTRAINT enforce_srid_geom CHECK (srid(geom) = 4326)
)
WITHOUT OIDS;
However, when I am creating a new feature type, the location_id doesn't
appear.
Schema Base:
sitename: string nillable:true min:0 max:1
source_desc: string nillable:true min:0 max:1
geom: pointProperty nillable:true min:0 max:1
The log file doesn't seem to report anything that looks interesting.
Any ideas on what's causing this?
- Tyler
--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org
Justin,
Thanks for the explanation. The reason for hiding the primary key column
makes sense to me... I just never noticed it before.
Cheers,
Tyler
Justin Deoliveira-4 wrote:
Hi Tyler,
This is occurring because location_id is the primary key of the table.
By default GeoServer will not publish primary key attributes as regular
feature attributes, so that they are never modified.
There is an option in the postgis datastore to return primary attributes
as normal attributes, but i don't think you can set if from geoserver
afaik.
Possible workarounds are turning oid's on (this may cause the postgis
fid mapper to chose oids and ignore the primary key, not 100% sure about
that will work though). Or choose a different column as the primary key.
-Justin
Tyler Erickson wrote:
I'm using 1.5.4. I have created a simple table with a geometry column in
postgis, but when I try to configure a featuretype, one of the columns
(location_id) does not appear. No errors appear (at least that I have
noticed). I can view the OpenLayers preview of the featuretype, and it
appears to work fine except location_id column is missing.
Other info... when I use uDig to browse the dataset the location_id
columns
appears fine.
Here is the postgis table definition:
CREATE TABLE t_location
(
location_id int4 NOT NULL,
sitename varchar(50),
source_desc varchar(254),
geom geometry,
CONSTRAINT t_location_pk PRIMARY KEY (location_id),
CONSTRAINT enforce_dims_geom CHECK (ndims(geom) = 2),
CONSTRAINT enforce_geotype_geom CHECK (geometrytype(geom) =
'POINT'::text
OR geom IS NULL),
CONSTRAINT enforce_srid_geom CHECK (srid(geom) = 4326)
)
WITHOUT OIDS;
However, when I am creating a new feature type, the location_id doesn't
appear.
Schema Base:
sitename: string nillable:true min:0 max:1
source_desc: string nillable:true min:0 max:1
geom: pointProperty nillable:true min:0 max:1
The log file doesn't seem to report anything that looks interesting.
Any ideas on what's causing this?
- Tyler
--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
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
--
View this message in context: http://www.nabble.com/missing-PostGIS-column-when-creating-FeatureType-tf4852487.html#a13915140
Sent from the GeoServer - User mailing list archive at Nabble.com.