public Object clone() { return new PGgeometry(geom); }
public Object clone() { return new PGgeometry(geom); }
String bbox ="SRID=4326;POLYGON(("+lu+","+lo+","+ro+","+ru+","+lu+"))"; pstmt.setObject(12,new PGgeometry(bbox));
String g = geolocation.getValue(); try { Geometry fr = new PGgeometry().geomFromString(g); Point p = fr.getPoint(0); this.geolocation = p; } catch (SQLException e) { e.printStackTrace(); }
@Override public NodeValue eval(NodeValue v) { // TODO If we evaluate to an PGgeometry object, then the call to geomFormText will not be pushed. try { return new NodeValueGeom(new PGgeometry(v.getString())); } catch (SQLException e) { throw new RuntimeException(e); } }
@Override public void setValue(PreparedStatement st, int startIndex, Geometry value) throws SQLException { PGgeometry geometry = new PGgeometry(PGgeometryConverter.convert(value)); st.setObject(startIndex, geometry); }
@Override public void setValue(PreparedStatement st, int startIndex, Geometry value) throws SQLException { PGgeometry geometry = new PGgeometry(PGgeometryConverter.convert(value)); st.setObject(startIndex, geometry); }
@Override public NodeValue eval(NodeValue v) { try { return new NodeValueGeom(new PGgeometry(v.getString())); } catch (SQLException e) { throw new RuntimeException(e); } }
public static NodeValue _makeNodeValue(PGobject o) { String type = o.getType(); if(type.equals("geography") || type.equals("geometry")) { try { PGgeometry geom = new PGgeometry(o.getValue()); return new NodeValueGeom(geom); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } } else { throw new NotImplementedException(); } return null; } }
statement.setObject(prmIndex++, new PGgeometry(geometries.get(i)));
/** * {@inheritDoc} */ @Override public void populateEntityParameters(Map<String, Object> args, Node entity) { populateCommonEntityParameters(args, entity); args.put("geom", new PGgeometry(pointBuilder.createPoint(entity.getLatitude(), entity.getLongitude()))); }
"CREATE TEMPORARY TABLE bbox_nodes ON COMMIT DROP AS" + " SELECT * FROM nodes WHERE (geom && ?)", new PGgeometry(bboxPolygon)); "CREATE TEMPORARY TABLE bbox_ways ON COMMIT DROP AS" + " SELECT * FROM ways WHERE (linestring && ?)", new PGgeometry(bboxPolygon));
/** * {@inheritDoc} */ @Override public int populateEntityParameters(PreparedStatement statement, int initialIndex, Node node) { int prmIndex; // Populate the entity level parameters. prmIndex = populateCommonEntityParameters(statement, initialIndex, node); try { // Set the node level parameters. statement.setObject( prmIndex++, new PGgeometry(pointBuilder.createPoint(node.getLatitude(), node.getLongitude()))); } catch (SQLException e) { throw new OsmosisRuntimeException( "Unable to set a prepared statement parameter for node " + node.getId() + ".", e); } return prmIndex; } }
return new PGgeometry(geom); else throw new UnsupportedOperationException("Conversion of "
"INSERT INTO box_node_list SELECT id FROM nodes WHERE (geom && ?)"); prmIndex = 1; preparedStatement.setObject(prmIndex++, new PGgeometry(bboxPolygon)); rowCount = preparedStatement.executeUpdate(); preparedStatement.close(); ); prmIndex = 1; preparedStatement.setObject(prmIndex++, new PGgeometry(bboxPolygon)); ); prmIndex = 1; preparedStatement.setObject(prmIndex++, new PGgeometry(bboxPolygon)); preparedStatement.setObject(prmIndex++, new PGgeometry(bboxPolygon));
object = new PGgeometry((org.postgis.Geometry) object);
org.postgis.Polygon pgPoly = new org.postgis.Polygon( linRing ); pgPoly.setSrid( parseSRID( geometry.getCoordinateSystem() ) ); return new PGgeometry( pgPoly );