Geometry
is the root class of the hierarchy. Geometry
是层次结构的根类。It is a noninstantiable class but has a number of properties, described in the following list, that are common to all geometry values created from any of the 它是一个不可实例化的类,但具有以下列表中所述的许多属性,这些属性对于从任何Geometry
subclasses. Geometry
子类创建的所有几何体值都是公用的。Particular subclasses have their own specific properties, described later.特定的子类有其自己的特定属性,稍后将进行描述。
Geometry Properties几何特性
A geometry value has the following properties:几何图形值具有以下特性:
Its type. 它的类型。Each geometry belongs to one of the instantiable classes in the hierarchy.每个几何体都属于层次结构中的一个可实例化类。
Its SRID, or spatial reference identifier. 它的SRID
,或空间引用标识符。This value identifies the geometry's associated spatial reference system that describes the coordinate space in which the geometry object is defined.该值标识几何图形的关联空间参照系,该参照系描述定义几何图形对象的坐标空间。
In MySQL, the SRID value is an integer associated with the geometry value. 在MySQL中,SRID值是与几何体值关联的整数。The maximum usable SRID value is 232−1. 最大可用SRID值为232−1。If a larger value is given, only the lower 32 bits are used.如果给定较大的值,则仅使用较低的32位。
SRID 0 represents an infinite flat Cartesian plane with no units assigned to its axes. SRID 0表示没有为其轴指定单位的无限平面笛卡尔平面。To ensure SRID 0 behavior, create geometry values using SRID 0. 要确保SRID 0的行为,请使用SRID 0创建几何体值。SRID 0 is the default for new geometry values if no SRID is specified.如果未指定SRID,则SRID 0是新几何体值的默认值。
For computations on multiple geometry values, all values must have the same SRID or an error occurs.对于多个几何体值的计算,所有值必须具有相同的SRID,否则会发生错误。
Its coordinates in its spatial reference system, represented as double-precision (8-byte) numbers. 它在空间参考系中的坐标,用双精度(8字节)数字表示。All nonempty geometries include at least one pair of (X,Y) coordinates. 所有非空几何体至少包含一对(X,Y)
坐标。Empty geometries contain no coordinates.空几何体不包含坐标。
Coordinates are related to the SRID. 坐标与SRID相关。For example, in different coordinate systems, the distance between two objects may differ even when objects have the same coordinates, because the distance on the planar coordinate system and the distance on the geodetic system (coordinates on the Earth's surface) are different things.例如,在不同的坐标系中,两个物体之间的距离可能会不同,即使物体具有相同的坐标,因为平面坐标系上的距离和大地坐标系(地球表面的坐标)上的距离是不同的。
Its interior, boundary, and exterior.
Every geometry occupies some position in space. The exterior of a geometry is all space not occupied by the geometry. The interior is the space occupied by the geometry. The boundary is the interface between the geometry's interior and exterior.
Its MBR (minimum bounding rectangle), or envelope. This is the bounding geometry, formed by the minimum and maximum (X,Y) coordinates:
((MINX MINY, MAXX MINY, MAXX MAXY, MINX MAXY, MINX MINY))
Whether the value is simple or nonsimple. Geometry values of types (LineString
, MultiPoint
, MultiLineString
) are either simple or nonsimple. Each type determines its own assertions for being simple or nonsimple.
Whether the value is closed or not closed. Geometry values of types (LineString
, MultiString
) are either closed or not closed. Each type determines its own assertions for being closed or not closed.
Whether the value is empty or nonempty A geometry is empty if it does not have any points. Exterior, interior, and boundary of an empty geometry are not defined (that is, they are represented by a NULL
value). An empty geometry is defined to be always simple and has an area of 0.
Its dimension. A geometry can have a dimension of −1, 0, 1, or 2:
−1 for an empty geometry.
0 for a geometry with no length and no area.
1 for a geometry with nonzero length and zero area.
2 for a geometry with nonzero area.
Point
objects have a dimension of zero. LineString
objects have a dimension of 1. Polygon
objects have a dimension of 2. The dimensions of MultiPoint
, MultiLineString
, and MultiPolygon
objects are the same as the dimensions of the elements they consist of.