Hi all,
being fed up all bug reports from Geoserver users
that are suffering on Oracle I decided to have a look and
at least I have made all tests available pass on my PC my Oracle 10g.
This involves changes to datastore factory, so that namespace is not
ignored, to make writing work when geometries are not the updated
fields, to using ReferencedEnvelope instead of the deprecated
JTS.ReferencedEnvelope.
Patch attached. Now, given that the maintainer has been ignoring
jira for months, either someone gives me a good reason not to
commit these patches, or I'll do it in a couple of hours on 2.2.x.
2.3.x and trunk.
Oh, a review would be appreciated as well.
Cheers
Andrea
PS: don't know if the first time the message went thru, I forgot
to attach the patch
Index: OracleDataStoreFactory.java
===================================================================
--- OracleDataStoreFactory.java (revisione 22893)
+++ OracleDataStoreFactory.java (copia locale)
@@ -158,7 +158,7 @@
String user = (String) USER.lookUp( params );
String passwd = (String) PASSWD.lookUp( params );
String schema = (String) SCHEMA.lookUp( params ); // checks uppercase
- //String namespace = (String) NAMESPACE.lookUp( params );
+ String namespace = (String) NAMESPACE.lookUp( params );
String dbtype = (String) DBTYPE.lookUp( params );
if( !"oracle".equals( dbtype )){
@@ -174,7 +174,7 @@
ConnectionPool pool = ocFactory.getConnectionPool();
- OracleDataStore dataStore = new OracleDataStore(pool, schema, new
HashMap());
+ OracleDataStore dataStore = new OracleDataStore(pool, namespace,
schema, new HashMap());
return dataStore;
} catch (SQLException ex) {
Index: OracleDataStore.java
===================================================================
--- OracleDataStore.java (revisione 22893)
+++ OracleDataStore.java (copia locale)
@@ -38,6 +38,7 @@
import org.geotools.filter.SQLEncoder;
import org.geotools.filter.SQLEncoderOracle;
import org.geotools.geometry.JTS;
+import org.geotools.geometry.jts.ReferencedEnvelope;
import org.geotools.referencing.CRS;
import org.opengis.referencing.FactoryException;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
@@ -325,7 +326,7 @@
}
}
Envelope extent = new Envelope(minx,maxx, miny,maxy );
- JTS.ReferencedEnvelope ref = new JTS.ReferencedEnvelope(
extent, crs );
+ ReferencedEnvelope ref = new ReferencedEnvelope( extent, crs );
return ref;
}
catch( Exception erp ){
Index: OracleFeatureWriter.java
===================================================================
--- OracleFeatureWriter.java (revisione 22893)
+++ OracleFeatureWriter.java (copia locale)
@@ -28,6 +28,7 @@
import oracle.sql.STRUCT;
import org.geotools.data.DataSourceException;
+import org.geotools.data.DataUtilities;
import org.geotools.data.FeatureReader;
import org.geotools.data.jdbc.JDBCTextFeatureWriter;
import org.geotools.data.jdbc.MutableFIDFeature;
@@ -103,7 +104,7 @@
for (int i = 0; i < current.getNumberOfAttributes(); i++) {
AttributeType type = schema.getAttributeType(i);
- if (type instanceof GeometricAttributeType) {
+ if (type instanceof GeometricAttributeType &&
!DataUtilities.attributesEqual(current.getAttribute(i), live.getAttribute(i))) {
Geometry geometry = (Geometry) current.getAttribute(i);
if (geometry == null) {
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel