Hi Justin,
I’m being a bit picky, but the method PostGISTestSetup.isVersion2() I would
rename to PostGISTestSetup.isAtleastVersion2() as it is a minimum test not an
equality test. And the following typical block of code:
run("INSERT INTO GEOMETRY_COLUMNS VALUES('', 'public', 'ft1',
'geometry', 2, '4326', 'POINT')");
if (isVersion2()) {
run("ALTER TABLE \"ft1\" ALTER COLUMN \"geometry\" TYPE
geometry(Point,4326);");
}
I would recode as:
if (isVersion2()) {
run("ALTER TABLE \"ft1\" ALTER COLUMN \"geometry\" TYPE
geometry(Point,4326);");
} else {
run("INSERT INTO GEOMETRY_COLUMNS VALUES('', 'public', 'ft1',
'geometry', 2, '4326', 'POINT')");
}
because the insert into geometry_columns does nothing in v2.0 The effect that
it did do is now done by the ALTER TABLE statement.
I haven’t used the ALTER TABLE statement to enforce a geometry but I use the
following three statement which replicates the pre v2.0 behaviour instead of
the ALTER TABLE statement.
CONSTRAINT enforce_dims_wkb_geometry CHECK (st_ndims(location) = 2),
CONSTRAINT enforce_geotype_wkb_geometry CHECK
(st_geometrytype(location) = 'POINT'::text),
CONSTRAINT enforce_srid_wkb_geometry CHECK (st_srid(location) = 4326)
The geometry_columns view in v2.0 uses the constraints to extract the metadata
for the spatial tables. If the ALTER TABLE statement does this then I am
happy. I haven’t read the PostGIS v2.0.0 manual thoroughly.
I haven’t done a thorough code review. Only looked at your patch. Hopefully all
the missing ST_ prefixes have been added.
Brett
From: Brett Walker [mailto:brett.wal...@geometryit.com]
Sent: Thursday, 21 June 2012 7:30 AM
To: Justin Deoliveira
Cc: geotools-devel@lists.sourceforge.net
Subject: Re: [Geotools-devel] [jira] (GEOT-4179) Postgis 2.0 support
Hi Justin,
I didn't notice the attached patch. I'll have a look latter and provide some
feedback.
Brett
Sent from my iPad
On 20/06/2012, at 11:48 PM, "Justin Deoliveira"
<jdeol...@opengeo.org<mailto:jdeol...@opengeo.org>> wrote:
Hey Brett,
On Tue, Jun 19, 2012 at 8:58 PM, Brett Walker
<brett.wal...@geometryit.com<mailto:brett.wal...@geometryit.com>> wrote:
Hi Justin,
I’ve looked into this also and have sent some of my findings to Andrea. I could
forward some of my finding to you if that would be helpful.
Sounds good. Have you taken a look at the patch I attached to the ticket? Do
they answer your concerns?
I would also add that the testing framework also needs some attention in light
of Postgis 2.0 requirements. My concern is how to make the tests work on
Postgis 2.0 and pre-Postgis 2.0 without getting to fancy.
Can you be more specific? The approach I took was to more or less to do version
checking in the dialect itself (which we already do) and act accordingly if
postgis >= 2.0 is in play.
Brett
From: Justin Deoliveira (JIRA)
[mailto:j...@codehaus.org<mailto:j...@codehaus.org>]
Sent: Wednesday, 20 June 2012 12:48 PM
To:
geotools-devel@lists.sourceforge.net<mailto:geotools-devel@lists.sourceforge.net>
Subject: [Geotools-devel] [jira] (GEOT-4179) Postgis 2.0 support
Justin
Deoliveira<https://jira.codehaus.org/secure/ViewProfile.jspa?name=jdeolive>
created GEOT-4179<https://jira.codehaus.org/browse/GEOT-4179>
Postgis 2.0 support<https://jira.codehaus.org/browse/GEOT-4179>
Issue Type:
Improvement
Affects Versions:
8.0-RC1
Assignee:
Justin
Deoliveira<https://jira.codehaus.org/secure/ViewProfile.jspa?name=jdeolive>
Components:
jdbc-postgis plugin
Created:
19/Jun/12 9:47 PM
Description:
A few things have to be updated to support postgis 2.0. The main ones are:
#. All the old style (non st prefix) functions are gone, so we must use the new
style
#. The geometry_columns table is now a view so updating it directly has no
affect, instead geometry metadata like arid are specified directly when
creating a geometry type
Project:
GeoTools<https://jira.codehaus.org/browse/GEOT>
Priority:
Major
Reporter:
Justin
Deoliveira<https://jira.codehaus.org/secure/ViewProfile.jspa?name=jdeolive>
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA
administrators<https://jira.codehaus.org/secure/ContactAdministrators!default.jspa>.
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net<mailto:GeoTools-Devel@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/geotools-devel
--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel