[fdo-users] OSGeo.PostgreSQL.3.5 Provider IGetSpatialContexts
hanko
hana.jaborova at spatialtechnology.se
Wed Jun 9 03:49:43 EDT 2010
Hi all,
I'm using the FDO to connect to PostGIS ("OSGeo.PostgreSQL.3.5")
I have created a new postgis database 'gisdb' with ICreateDataStore command
.
I n pgAdmin III I can see that it was created with schema 'public' that
contains two tables geometry_columns and spatial_ref_sys.
Then I tryed to create a new FeatureSchema. For GeometricPropertyDefinition
geom I defined
geom.SpatialContextAssociation = "3007"; //Srid
When I tryed to apply a new created FeatureSchema I gott an exception:
Message: "Schema MySchema has errors; cannot apply it "
InnerException = {"The spatial context name associated with geometry
property 'GEOMETRY' of the feature class 'Water' not found "}
I used a function GetSpatialContexts() that should list all spatial context
but it returned nothinhg.
public ReadOnlyCollection<SpatialContextInfo> GetSpatialContexts()
{
List<SpatialContextInfo> contexts = new List<SpatialContextInfo>();
IConnectionPropertyDictionary connProperties =
FDOConnection.ConnectionInfo.ConnectionProperties;
connProperties.SetProperty("Username", _userPostGIS);
connProperties.SetProperty("Password", _passwordPostGIS);
connProperties.SetProperty("Service", _servicePostGIS);
connProperties.SetProperty("DataStore", _dataStore);
FDOConnection.Open();
if (FDOConnection.ConnectionState == ConnectionState.ConnectionState_Open)
{
using (IGetSpatialContexts get =
FDOConnection.CreateCommand(OSGeo.FDO.Commands.CommandType.CommandType_GetSpatialContexts)
as IGetSpatialContexts)
{
get.ActiveOnly = false;
using (ISpatialContextReader reader = get.Execute())
{
while (reader.ReadNext()) //nothing returned
{
SpatialContextInfo info = new SpatialContextInfo(reader);
contexts.Add(info);
}
}
}
}
return contexts.AsReadOnly();
}
Any ideas?
Thank in advance
Hanko
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/OSGeo-PostgreSQL-3-5-Provider-IGetSpatialContexts-tp5157165p5157165.html
Sent from the FDO Users mailing list archive at Nabble.com.
More information about the fdo-users
mailing list