More robust behaviour if geography_columns not readable
-------------------------------------------------------
Key: GEOT-3603
URL: http://jira.codehaus.org/browse/GEOT-3603
Project: GeoTools
Issue Type: Improvement
Components: data postgis
Affects Versions: 2.7.2, 8.0-M1
Reporter: Ben Caradoc-Davies
Assignee: Justin Deoliveira
Priority: Minor
gt-jdbc-postgis should be able to determine the SRID of a geometry column even
if geography_columns is not readable. Because the presence of geography_columns
is a new feature in PostGIS 1.5, we can expect more users to be caught out as
permissions settings in existing deployment procedures probably do not cater
for it.
{code}
-------- Original Message --------
Subject: [ExternalEmail] Re: [Geotools-gt2-users] Permission Denied Error on a
PostGIS Query
Date: Tue, 24 May 2011 16:51:48 +0800
From: Ben Caradoc-Davies <[email protected]>
To: Gerson Galang <[email protected]>
CC: [email protected]
<[email protected]>
I think your request succeeded, but I suspect that, because of the error
encountered while trying to determine the SRID, your geometries won't
have a SRID until you grant at a minimum read access to
geography_columns, and so spatial operations including reprojection will
likely fail.
On 24/05/11 14:55, Gerson Galang wrote:
> Note that I still get "1" as the output in stdout even if the exception
> gets thrown in stderr.
{code}
{code}
-------- Original Message --------
Subject: [ExternalEmail] Re: [Geotools-gt2-users] Permission Denied Error on a
PostGIS Query
Date: Tue, 24 May 2011 16:22:30 +0800
From: Ben Caradoc-Davies
To: Gerson Galang
CC: [email protected]
alter view geography_columns owner to gis;
You can see views with \dv (no semicolon required as this is a postgres
command and not SQL).
On 24/05/11 14:55, Gerson Galang wrote:
> 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
{code}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery,
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now.
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel