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; }
/** * 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(); }
public Object clone() { PGboxbase obj = newInstance(); obj.llb = this.llb; obj.urt = this.urt; obj.setType(type); return obj; }
@Override public Envelope getBBoxAggregateValue( ResultSet rs, int colIdx, ICRS crs ) throws SQLException { Envelope env = null; PGboxbase pgBox = (PGboxbase) rs.getObject( colIdx ); if ( pgBox != null ) { org.deegree.geometry.primitive.Point min = buildPoint( pgBox.getLLB(), crs ); org.deegree.geometry.primitive.Point max = buildPoint( pgBox.getURT(), crs ); env = new DefaultEnvelope( null, crs, null, min, max ); } return env; }
private void outerWKT(StringBuffer sb) { sb.append(getPrefix()); sb.append('('); llb.innerWKT(sb); sb.append(','); urt.innerWKT(sb); sb.append(')'); }
private Geometry convertBox(PGboxbase box) { Point ll = box.getLLB(); Point ur = box.getURT(); Coordinate[] ringCoords = new Coordinate[5]; if (box instanceof org.postgis.PGbox2d) { ringCoords[0] = new Coordinate(ll.x, ll.y); ringCoords[1] = new Coordinate(ur.x, ll.y); ringCoords[2] = new Coordinate(ur.x, ur.y); ringCoords[3] = new Coordinate(ll.x, ur.y); ringCoords[4] = new Coordinate(ll.x, ll.y); } else { ringCoords[0] = new Coordinate(ll.x, ll.y, ll.z); ringCoords[1] = new Coordinate(ur.x, ll.y, ll.z); ringCoords[2] = new Coordinate(ur.x, ur.y, ur.z); ringCoords[3] = new Coordinate(ll.x, ur.y, ur.z); ringCoords[4] = new Coordinate(ll.x, ll.y, ll.z); } com.vividsolutions.jts.geom.LinearRing shell = getGeometryFactory() .createLinearRing(ringCoords); return getGeometryFactory().createPolygon(shell, null); }
public Object clone() { PGboxbase obj = newInstance(); obj.llb = this.llb; obj.urt = this.urt; obj.setType(type); return obj; }
private void outerWKT(StringBuffer sb) { sb.append(getPrefix()); sb.append('('); llb.innerWKT(sb); sb.append(','); urt.innerWKT(sb); sb.append(')'); }
@Override public Object getObject(int columnIndex) throws SQLException { Object object = rs.getObject(columnIndex); if(spatialFields.contains(columnIndex)) { if(object instanceof JtsGeometry) { return ((JtsGeometry) object).getGeometry(); } else if(object instanceof PGboxbase) { PGboxbase box = ((PGboxbase) object); Point bottomLeft = box.getLLB(); Point upRight = box.getURT(); Envelope envelope = new Envelope(bottomLeft.x, upRight.x, bottomLeft.y, upRight.y); return geometryFactory.toGeometry(envelope); } } if(object instanceof PGobject) { return new PGObjectWrapper((PGobject) object); } else { return object; } }
public void setValue(String value) throws SQLException { int srid = Geometry.UNKNOWN_SRID; value = value.trim(); if (value.startsWith("SRID=")) { String[] temp = PGgeometry.splitSRID(value); value = temp[1].trim(); srid = Geometry.parseSRID(Integer.parseInt(temp[0].substring(5))); } String myPrefix = getPrefix(); if (value.startsWith(myPrefix)) { value = value.substring(myPrefix.length()).trim(); } String valueNoParans = GeometryTokenizer.removeLeadingAndTrailingStrings(value.trim(), "(", ")"); List<String> tokens = GeometryTokenizer.tokenize(valueNoParans, ','); llb = new Point(tokens.get(0)); urt = new Point(tokens.get(1)); if (srid != Geometry.UNKNOWN_SRID) { llb.setSrid(srid); urt.setSrid(srid); } }
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; }
/** * 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(); }
@Override public Object getObject(int columnIndex) throws SQLException { Object object = rs.getObject(columnIndex); if(spatialFields.contains(columnIndex)) { if(object instanceof JtsGeometry) { return ((JtsGeometry) object).getGeometry(); } else if(object instanceof PGboxbase) { PGboxbase box = ((PGboxbase) object); Point bottomLeft = box.getLLB(); Point upRight = box.getURT(); Envelope envelope = new Envelope(bottomLeft.x, upRight.x, bottomLeft.y, upRight.y); return geometryFactory.toGeometry(envelope); } } if(object instanceof PGobject) { return new PGObjectWrapper((PGobject) object); } else { return object; } }
public void setValue(String value) throws SQLException { int srid = Geometry.UNKNOWN_SRID; value = value.trim(); if (value.startsWith("SRID=")) { String[] temp = PGgeometry.splitSRID(value); value = temp[1].trim(); srid = Geometry.parseSRID(Integer.parseInt(temp[0].substring(5))); } String myPrefix = getPrefix(); if (value.startsWith(myPrefix)) { value = value.substring(myPrefix.length()).trim(); } String valueNoParans = GeometryTokenizer.removeLeadingAndTrailingStrings(value.trim(), "(", ")"); List<String> tokens = GeometryTokenizer.tokenize(valueNoParans, ','); llb = new Point(tokens.get(0)); urt = new Point(tokens.get(1)); if (srid != Geometry.UNKNOWN_SRID) { llb.setSrid(srid); urt.setSrid(srid); } }
@Override public Object getObject(int columnIndex) throws SQLException { Object object = rs.getObject(columnIndex); if(spatialFields.contains(columnIndex)) { if(object instanceof JtsGeometry) { return ((JtsGeometry) object).getGeometry(); } else if(object instanceof PGboxbase) { PGboxbase box = ((PGboxbase) object); Point bottomLeft = box.getLLB(); Point upRight = box.getURT(); Envelope envelope = new Envelope(bottomLeft.x, upRight.x, bottomLeft.y, upRight.y); return geometryFactory.toGeometry(envelope); } } if(object instanceof PGobject) { return new PGObjectWrapper((PGobject) object); } else { return object; } }