import org.postgresql.util.*;
import java.sql.*;
+/*
+ * Updates Oct 2002
+ * - data members made private
+ * - getLLB() and getURT() methods added
+ */
+
public class PGbox3d extends PGobject
{
/**
* The lower left bottom corner of the box.
*/
- Point llb;
+ private Point llb;
/**
* The upper right top corner of the box.
*/
- Point urt;
+ private Point urt;
public PGbox3d() {}
return getValue();
}
- public Object clone()
- {
+ public Object clone() {
PGbox3d obj = new PGbox3d(llb,urt);
obj.setType(type);
return obj;
}
+ /**Returns the lower left bottom corner of the box as a Point object*/
+ public Point getLLB() {
+ return llb;
+ }
+
+ /**Returns the upper right top corner of the box as a Point object*/
+ public Point getURT() {
+ return urt;
+ }
+
}
package org.postgis;
import org.postgresql.util.PGobject;
+import org.postgresql.util.PGtokenizer;
import java.sql.*;
+/*
+ * Updates Oct 2002
+ * - setValue() method now cheaks if the geometry has a SRID. If present,
+ * it is removed and only the wkt is used to create the new geometry
+ */
+
public class PGgeometry extends PGobject
{
Geometry geom;
- public PGgeometry() {}
+ public PGgeometry() { }
public PGgeometry(Geometry geom) {
- this.geom = geom;
+ this.geom = geom;
}
public PGgeometry(String value) throws SQLException
public void setValue(String value) throws SQLException
{
value = value.trim();
+ if( value.startsWith("SRID")) {
+ //break up geometry into srid and wkt
+ PGtokenizer t = new PGtokenizer(value,';');
+ value = t.getToken(1);
+ }
+
if( value.startsWith("MULTIPOLYGON")) {
geom = new MultiPolygon(value);
} else if( value.startsWith("MULTILINESTRING")) {