ThinkGeo.com    |     Documentation    |     Premium Support

Please Delete this question

My mistake.  My connection string was pointed to the wrong database.


 


 


I'm currently using the evaluation version that I downloaded today (MapSuiteCore:3.1.235;DesktopEdition:3.0.415).


I'm trying to access data from a PostgreSQL table.  If I run the following code, I get an NpgsqlException: ERROR: 42P01: relation "g101_roads" does not exist


 


 PostgreSqlFeatureSource featureSource = new PostgreSqlFeatureSource( Program.Settings.ConnectionString, "g101_roads", "id" );


featureSource.ExecutingSqlStatement += new EventHandler<executingsqlstatementpostgresqlfeaturesourceeventargs>( featureSource_ExecutingSqlStatement );


featureSource.Open();


RectangleShape boundingBox = featureSource.GetBoundingBox();


 


I'm using PostgreSqlFeatureSource as opposed to PostgreSqlFeatureLayer because it supports the ExecutingSqlStatement event which I used to see what query is actually going to the server.


 


For featureSource.Open(): select f_geometry_column,srid from geometry_columns where f_table_name='g101_roads'


This works fine and if I look at featureSource.Srid, I see 4326 which is correct.


 


For featureSource.GetBoundingBox(): SELECT asbinary(ST_EXTENT("imp_geometry")) FROM "g101_roads";


This does not work, resulting in the exception above.  If I run this statement directly in my database browser it works fine and returns the extent I expect.


 


Any ideas?


 


Thanks,

Chris



Chris, 
  
 Thanks for your interests in Map Suite product and welcome you to Desktop Edition post forum! 
  
 Please feel conformable to keep this post. 
  
 Any more questions just let me know. 
 Thanks. 
  
 Yale