From: Gerson G. <ger...@gm...> - 2011-05-24 06:55:56
|
Hi Guys, I ingested a couple of shape files into PostGIS and after running a query against it, an exception gets thrown even if the query returns a proper response. Here are the tables I have in my DB: geo=# \dt; List of relations Schema | Name | Type | Owner --------+-------------------+-------+------- public | geometry_columns | table | gis public | lga07aaust_region | table | gis public | spatial_ref_sys | table | gis public | ssc06aaust_region | table | gis Here's the code snippet that I'm trying to execute: String typeName = "ssc06aaust_region"; FeatureSource source = dataStore.getFeatureSource(typeName); Filter filter = CQL .toFilter("name_2006 = 'Melbourne'"); FeatureCollection<SimpleFeatureType, SimpleFeature> features = source .getFeatures(filter); System.out.println(features.size()); And the exception that it throws back to the terminal: May 24, 2011 2:55:14 PM org.geotools.jdbc.JDBCFeatureSource buildFeatureType WARNING: Error occured determing srid for ssc06aaust_region.wkb_geometry org.postgresql.util.PSQLException: ERROR: permission denied for relation geography_columns at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2062) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1795) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:353) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:252) at org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:208) at org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:208) at org.geotools.data.postgis.PostGISDialect.getGeometrySRID(PostGISDialect.java:386) at org.geotools.jdbc.JDBCFeatureSource.buildFeatureType(JDBCFeatureSource.java:291) at org.geotools.jdbc.JDBCDataStore.createFeatureSource(JDBCDataStore.java:767) at org.geotools.data.store.ContentDataStore.getFeatureSource(ContentDataStore.java:384) at org.geotools.data.store.ContentDataStore.getFeatureSource(ContentDataStore.java:349) at org.geotools.data.store.ContentDataStore.getFeatureSource(ContentDataStore.java:102) at au.org.aurin.wfs.client.QueryLab.filterFeatures(QueryLab.java:116) at au.org.aurin.wfs.client.QueryLab.connect(QueryLab.java:103) at au.org.aurin.wfs.client.QueryLab.<init>(QueryLab.java:67) at au.org.aurin.wfs.client.QueryLab.main(QueryLab.java:54) Note that I still get "1" as the output in stdout even if the exception gets thrown in stderr. Any ideas? Thanks, Gerson |