[fdo-users] Re: OSGeo.PostgreSQL.3.5 Provider Create Schema

Brent Robinson brent.robinson at autodesk.com
Thu Jun 10 07:26:51 EDT 2010

Hi Hanko,

This problem is specific to the combination of the PostgreSQL 3.5 provider and PostGIS 1.5. PostGIS 1.5.0 was released not long before the provider, so the provider was built and tested against PostGIS 1.4. The geography_columns view was introduced by 1.5 and the PostgreSQL provider unsuccessfully tries to generate a feature class from it. This problem has been fixed in the FDO trunk by recognizing geography_columns as a system view and skipping the generation of the feature class. The fix will probably show up in version 3.6 of the provider.

If you don't need anything that is specifically in 1.5, a workaround would be to roll back to 1.4. 
In another posting you mentioned that removing the geography_columns view gets rid of the error. This would work, as long as you don't need the geography column type, but I don't know if there are any other side effects. I'll do a bit more checking to see if there are any other alternatives.


-----Original Message-----
From: fdo-users-bounces at lists.osgeo.org [mailto:fdo-users-bounces at lists.osgeo.org] On Behalf Of hanko
Sent: Thursday, June 10, 2010 2:38 AM
To: fdo-users at lists.osgeo.org
Subject: [fdo-users] Re: OSGeo.PostgreSQL.3.5 Provider Create Schema

Hi all, 

1.I can create a new database 'gisdb' with OSGeo.PostgreSQL.3.5 Provider
without problems.
A schema 'public' is created with two tables 'geometry_columns' and
'spatial_ref_sys'  and a view 'geography_columns'.

2.If I want to list spatial context in 'gisdb'  with IGetSpatialContexts
there is none.
3.I create a new simple Feature Schema 'ShipSysSchema 'and I set
geometricProperty.SpatialContextAssociation = "3007";	//srid
When I apply my new schema I gott an exception
{"Schema ShipSysSchema has errors; cannot apply it "}
InnerException	{"The spatial context name associated with geometry property
'Geom' of the feature class 'Ship' not found "}	
System.Exception {OSGeo.FDO.Common.Exception}

4.I create a new spatial context srid = 3007,  SWEREF99 with
A new table f_scinfo in PostGIS 'gisdb' public schema is created. 

  f_scinfo_id bigint NOT NULL,
  "3007" geometry,
  CONSTRAINT public_pk_f_scinfo PRIMARY KEY (f_scinfo_id),
  CONSTRAINT enforce_dims_3007 CHECK (st_ndims("3007") = 2),
  CONSTRAINT enforce_srid_3007 CHECK (st_srid("3007") = (-1))

5.Then I apply a Feature schema 'ShipSysSchema'. 
I gott an exception
{"Schema ShipSysSchema has errors; cannot apply it "} 
InnerException	{"Error in Column
gisdb.public.geography_columns.f_geography_column: length or precision 0 is
less than minimum allowed (1) "}	System.Exception

Any ideas?

View this message in context: http://osgeo-org.1803224.n2.nabble.com/OSGeo-PostgreSQL-3-5-Provider-Create-Schema-tp5157464p5161845.html
Sent from the FDO Users mailing list archive at Nabble.com.
fdo-users mailing list
fdo-users at lists.osgeo.org

More information about the fdo-users mailing list