/** * adds the JTS/PostGIS Data types to a PG 7.2 Connection. * * @param pgconn The PGConnection object to add the types to * @throws SQLException when a SQLException occurs */ public static void addGISTypes72(org.postgresql.PGConnection pgconn) throws SQLException { loadTypesAdder("72").addGT((Connection) pgconn, false); }
private Polygon createWayBbox(double left, double right, double bottom, double top) { Point[] points; LinearRing ring; Polygon bbox; points = new Point[5]; points[0] = new Point(left, bottom); points[1] = new Point(left, top); points[2] = new Point(right, top); points[3] = new Point(right, bottom); points[4] = new Point(left, bottom); ring = new LinearRing(points); bbox = new Polygon(new LinearRing[] {ring}); bbox.srid = 4326; return bbox; }
public boolean checkConsistency() { return super.checkConsistency() && (this.dimension == 3 || this.z == 0.0) && (this.haveMeasure || this.m == 0.0); } }
public LineString reverse() { Point[] points = this.getPoints(); int l = points.length; int i, j; Point[] p = new Point[l]; for (i = 0, j = l - 1; i < l; i++, j--) { p[i] = points[j]; } return new LineString(p); }
/** * Return the Type as String * * @return String representation for the type of this geometry */ public String getTypeString() { return getTypeString(this.type); }
/** * Maybe we could add more error checking here? * * @param value String representing the geometry * @param bp BinaryParser to use whe parsing * @return Geometry object parsed from the specified string value * @throws SQLException when a SQLException occurs */ public static Geometry geomFromString(String value, BinaryParser bp) throws SQLException { return geomFromString(value, bp, false); }
protected boolean useLW(Connection conn) { try { return supportsEWKB(conn); } catch (SQLException e) { // fail safe default return false; } }
/** * Unlike geometries, toString() does _not_ contain the srid, as server-side * PostGIS cannot parse this. * * @return String representation of this box */ public String toString() { return getValue(); }
/** * java.lang.Object equals implementation * * @param other geometry to compare * @return true if equal, false otherwise */ public boolean equals(Object other) { return (other != null) && (other instanceof Geometry) && equals((Geometry) other); }
public boolean equals(Object other) { if (other instanceof PGboxbase) { PGboxbase otherbox = (PGboxbase) other; return (compareLazyDim(this.llb, otherbox.llb) && compareLazyDim(this.urt, otherbox.urt)); } return false; }
private Polygon createWayBbox(double left, double right, double bottom, double top) { Point[] points; LinearRing ring; Polygon bbox; points = new Point[5]; points[0] = new Point(left, bottom); points[1] = new Point(left, top); points[2] = new Point(right, top); points[3] = new Point(right, bottom); points[4] = new Point(left, bottom); ring = new LinearRing(points); bbox = new Polygon(new LinearRing[] {ring}); bbox.srid = 4326; return bbox; }
/** * adds the JTS/PostGIS Data types to a PG 8.0+ Connection. * * @param pgconn The PGConnection object to add the types to * @throws SQLException when a SQLException occurs */ public static void addGISTypes80(PGConnection pgconn) throws SQLException { loadTypesAdder("80").addGT((Connection) pgconn, false); }
/** * adds the JTS/PostGIS Data types to a PG 7.3+ Connection. If you use * PostgreSQL jdbc drivers V8.0 or newer, those methods are deprecated due * to some class loader problems (but still work for now), and you may want * to use the method below instead. * * @param pgconn The PGConnection object to add the types to * @throws SQLException when a SQLException occurs * */ public static void addGISTypes(PGConnection pgconn) throws SQLException { loadTypesAdder("74").addGT((Connection) pgconn, false); }
/** * adds the JTS/PostGIS Data types to a PG 7.2 Connection. * * @param pgconn The PGConnection object to add the types to * @throws SQLException when a SQLException occurs */ public static void addGISTypes72(org.postgresql.PGConnection pgconn) throws SQLException { loadTypesAdder("72").addGT((Connection) pgconn, false); }
/** * adds the JTS/PostGIS Data types to a PG 8.0+ Connection. * * @param pgconn The PGConnection object to add the types to * @throws SQLException when a SQLException occurs */ public static void addGISTypes80(PGConnection pgconn) throws SQLException { loadTypesAdder("80").addGT((Connection) pgconn, false); }
/** * adds the JTS/PostGIS Data types to a PG 7.3+ Connection. If you use * PostgreSQL jdbc drivers V8.0 or newer, those methods are deprecated due * to some class loader problems (but still work for now), and you may want * to use the method below instead. * * @param pgconn The PGConnection object to add the types to * @throws SQLException when a SQLException occurs * */ public static void addGISTypes(PGConnection pgconn) throws SQLException { loadTypesAdder("74").addGT((Connection) pgconn, false); }