我用一下方法生成一个圆形,
    private static com.vividsolutions.jts.geom.Geometry createCircle(double x, double y, final double RADIUS) {
GeometryFactory geometryFactory = new GeometryFactory();
final int SIDES = 32;
Coordinate coords[] = new Coordinate[SIDES + 1]; 
// double x, y; //Circle center
for (int i = 0; i < SIDES; i++) {
    double angle = ((double) i / (double) SIDES) * Math.PI * 2;
    double dx = Math.cos(angle) * RADIUS;
    double dy = Math.sin(angle) * RADIUS;
    coords[i] = new Coordinate((double) x + dx, (double) y + dy);
}
coords[SIDES] = coords[0];
com.vividsolutions.jts.geom.LinearRing ring = geometryFactory.createLinearRing(coords);
Polygon polygon = geometryFactory.createPolygon(ring, null);
com.vividsolutions.jts.geom.Geometry geom = (com.vividsolutions.jts.geom.Geometry) polygon;
return geom;
    }
然后用一下方法存入mysql中,
insert into table (a, b, c, d) values('88888',0,0,GeomFromText('" +geom.toString()+ "'))
然后,我想用'MBRIntersects'方法查询出数据库中已有的,被此圆包含和与该圆相交的多边形,查询出的多边形应该组成一个近似圆的形状,但确是一个方形。
有高人知道为什么不?
谢谢