Changing Postgis Connection

Mar 10, 2009 at 5:32 PM
Edited Mar 10, 2009 at 5:33 PM

Hi

I have been using the following connection with great success.

 _sharpMap = new Map(new Size(1000, 900)) { BackColor = Color.Silver };
PostGIS provider = new PostGIS(connectionString, "p_id.p_id", "the_geom", "public"); //create a new provider
VectorLayer myLayer = new VectorLayer("My Layer");
myLayer.Style = new VectorStyle

However I need to change the table name from p_id.p_id to p_id.image.

When I make the change I get this error -

  BaseMessage="missing FROM-clause entry for table \"p_id\""
Code="42P01"
Detail=""
ErrorSql="SELECT AsBinary(the_geom) AS Geom FROM p_id.Image WHERE P_ID.P_ID.P_ID_ID= '309'\r\n AND the_geom && box2d('BOX3D(-0.5 -0.45,0.5 0.45)'::box3d)"

It would appear to this neophyte, that the select clause has been established somewhere and isn't being changed by the new entry- but I can't find where it is.

Any help appreciated.

Bob

Coordinator
Mar 10, 2009 at 8:03 PM
Edited Mar 10, 2009 at 8:13 PM
Hi Bob,
it looks to me that you have set the DefinitionQuery of your postgis provider to
P_ID.P_ID.P_ID_ID= '309'
and that does not match with your new table. You may have to adjust OID- and geometry-column, too.
Hth
FObermaier

update:
Just in case you did not know: the last parameter to the constructor of the postgis provider is the name of the 'column with unique identifier' and not the schema.
Have you tried to use the constructor like this:
new PostGIS(connectionString, "p_id.p_id", "the_geom", "p_id_id")
Mar 10, 2009 at 8:51 PM
I must be going blind!
Thanks fobermaier
Bob
----- Original Message -----
From: [email removed]
To: [email removed]
Sent: Tuesday, March 10, 2009 1:03 PM
Subject: Re: Changing Postgis Connection [SharpMap:49755]

From: fobermaier

Hi Bob,
it looks to me that you have set the DefinitionQuery of your postgis provider to
P_ID.P_ID.P_ID_ID= '309'
and that does not match with your new table. Hth FObermaier