Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
7d2fd6e9
Unverified
提交
7d2fd6e9
authored
9月 14, 2018
作者:
Evgenij Ryazanov
提交者:
GitHub
9月 14, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1445 from katzyn/geometry
Use PostGIS-compatible format for SRID-only constraint in GEOMETRY
上级
771013f8
7e86ef4e
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
22 行增加
和
13 行删除
+22
-13
help.csv
h2/src/docsrc/help/help.csv
+11
-4
Parser.java
h2/src/main/org/h2/command/Parser.java
+5
-2
ExtTypeInfoGeometry.java
h2/src/main/org/h2/value/ExtTypeInfoGeometry.java
+4
-5
geometry.sql
h2/src/test/org/h2/test/scripts/datatypes/geometry.sql
+2
-2
没有找到文件。
h2/src/docsrc/help/help.csv
浏览文件 @
7d2fd6e9
...
@@ -3037,8 +3037,15 @@ ENUM('clubs', 'diamonds', 'hearts', 'spades')
...
@@ -3037,8 +3037,15 @@ ENUM('clubs', 'diamonds', 'hearts', 'spades')
"
"
"Data Types","GEOMETRY Type","
"Data Types","GEOMETRY Type","
GEOMETRY
GEOMETRY
[({ sridInt | { {POINT|LINESTRING|POLYGON|MULTIPOINT|MULTILINESTRING
[({ GEOMETRY |
|MULTIPOLYGON|GEOMETRYCOLLECTION} [Z|M|ZM] [, sridInt]} })]
{ POINT
| LINESTRING
| POLYGON
| MULTIPOINT
| MULTILINESTRING
| MULTIPOLYGON
| GEOMETRYCOLLECTION } [Z|M|ZM]}
[, sridInt] )]
","
","
A spatial geometry type.
A spatial geometry type.
If additional constraints are not specified this type accepts all supported types of geometries.
If additional constraints are not specified this type accepts all supported types of geometries.
...
@@ -3046,8 +3053,8 @@ A constraint with required geometry type and dimension system can be set by spec
...
@@ -3046,8 +3053,8 @@ A constraint with required geometry type and dimension system can be set by spec
dimension system. A whitespace between them is optional.
dimension system. A whitespace between them is optional.
2D dimension system does not have a name and assumed if only a geometry type name is specified.
2D dimension system does not have a name and assumed if only a geometry type name is specified.
POINT means 2D point, POINT Z or POINTZ means 3D point.
POINT means 2D point, POINT Z or POINTZ means 3D point.
GEOMETRY constraint means no restrictions on type or dimension system of geometry.
A constraint with required spatial reference system identifier (SRID) can be set by specifying this identifier.
A constraint with required spatial reference system identifier (SRID) can be set by specifying this identifier.
Both constraints for type and SRID can be specified together.
Mapped to ""org.locationtech.jts.geom.Geometry"" if JTS library is in classpath and to ""java.lang.String"" otherwise.
Mapped to ""org.locationtech.jts.geom.Geometry"" if JTS library is in classpath and to ""java.lang.String"" otherwise.
May be represented in textual format using the WKT (well-known text) or EWKT (extended well-known text) format.
May be represented in textual format using the WKT (well-known text) or EWKT (extended well-known text) format.
...
@@ -3064,7 +3071,7 @@ GEOMETRY
...
@@ -3064,7 +3071,7 @@ GEOMETRY
GEOMETRY(POINT)
GEOMETRY(POINT)
GEOMETRY(POINT Z)
GEOMETRY(POINT Z)
GEOMETRY(POINT Z, 4326)
GEOMETRY(POINT Z, 4326)
GEOMETRY(4326)
GEOMETRY(
GEOMETRY,
4326)
"
"
"Data Types","INTERVAL Type","
"Data Types","INTERVAL Type","
...
...
h2/src/main/org/h2/command/Parser.java
浏览文件 @
7d2fd6e9
...
@@ -5049,7 +5049,10 @@ public class Parser {
...
@@ -5049,7 +5049,10 @@ public class Parser {
if
(
extTypeInfo
==
null
)
{
if
(
extTypeInfo
==
null
)
{
if
(
readIf
(
OPEN_PAREN
))
{
if
(
readIf
(
OPEN_PAREN
))
{
int
type
=
0
;
int
type
=
0
;
if
(
currentTokenType
==
IDENTIFIER
&&
!
currentTokenQuoted
)
{
if
(
currentTokenType
!=
IDENTIFIER
||
currentTokenQuoted
)
{
throw
getSyntaxError
();
}
if
(!
readIf
(
"GEOMETRY"
))
{
try
{
try
{
type
=
EWKTUtils
.
parseGeometryType
(
currentToken
);
type
=
EWKTUtils
.
parseGeometryType
(
currentToken
);
read
();
read
();
...
@@ -5062,7 +5065,7 @@ public class Parser {
...
@@ -5062,7 +5065,7 @@ public class Parser {
}
}
}
}
Integer
srid
=
null
;
Integer
srid
=
null
;
if
(
type
==
0
||
readIf
(
COMMA
))
{
if
(
readIf
(
COMMA
))
{
srid
=
readInt
();
srid
=
readInt
();
}
}
read
(
CLOSE_PAREN
);
read
(
CLOSE_PAREN
);
...
...
h2/src/main/org/h2/value/ExtTypeInfoGeometry.java
浏览文件 @
7d2fd6e9
...
@@ -24,14 +24,13 @@ public final class ExtTypeInfoGeometry extends ExtTypeInfo {
...
@@ -24,14 +24,13 @@ public final class ExtTypeInfoGeometry extends ExtTypeInfo {
}
}
StringBuilder
builder
=
new
StringBuilder
();
StringBuilder
builder
=
new
StringBuilder
();
builder
.
append
(
'('
);
builder
.
append
(
'('
);
if
(
type
!=
0
)
{
if
(
type
==
0
)
{
builder
.
append
(
"GEOMETRY"
);
}
else
{
builder
.
append
(
EWKTUtils
.
formatGeometryTypeAndDimensionSystem
(
type
));
builder
.
append
(
EWKTUtils
.
formatGeometryTypeAndDimensionSystem
(
type
));
}
}
if
(
srid
!=
null
)
{
if
(
srid
!=
null
)
{
if
(
type
!=
0
)
{
builder
.
append
(
", "
).
append
((
int
)
srid
);
builder
.
append
(
", "
);
}
builder
.
append
((
int
)
srid
);
}
}
return
builder
.
append
(
')'
).
toString
();
return
builder
.
append
(
')'
).
toString
();
}
}
...
...
h2/src/test/org/h2/test/scripts/datatypes/geometry.sql
浏览文件 @
7d2fd6e9
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
-- Initial Developer: H2 Group
-- Initial Developer: H2 Group
--
--
CREATE
TABLE
TEST
(
G
GEOMETRY
,
G_S
GEOMETRY
(
1
),
P
GEOMETRY
(
POINT
),
P_S
GEOMETRY
(
POINT
,
1
),
CREATE
TABLE
TEST
(
G
GEOMETRY
,
G_S
GEOMETRY
(
GEOMETRY
,
1
),
P
GEOMETRY
(
POINT
),
P_S
GEOMETRY
(
POINT
,
1
),
PZ1
GEOMETRY
(
POINT
Z
),
PZ2
GEOMETRY
(
POINTZ
),
PZ1_S
GEOMETRY
(
POINT
Z
,
1
),
PZ2_S
GEOMETRY
(
POINTZ
,
1
),
PZ1
GEOMETRY
(
POINT
Z
),
PZ2
GEOMETRY
(
POINTZ
),
PZ1_S
GEOMETRY
(
POINT
Z
,
1
),
PZ2_S
GEOMETRY
(
POINTZ
,
1
),
PM
GEOMETRY
(
POINT
M
),
PZM
GEOMETRY
(
POINT
ZM
),
PZM_S
GEOMETRY
(
POINT
ZM
,
-
100
),
PM
GEOMETRY
(
POINT
M
),
PZM
GEOMETRY
(
POINT
ZM
),
PZM_S
GEOMETRY
(
POINT
ZM
,
-
100
),
LS
GEOMETRY
(
LINESTRING
),
PG
GEOMETRY
(
POLYGON
),
LS
GEOMETRY
(
LINESTRING
),
PG
GEOMETRY
(
POLYGON
),
...
@@ -24,7 +24,7 @@ SELECT COLUMN_NAME, TYPE_NAME, COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
...
@@ -24,7 +24,7 @@ SELECT COLUMN_NAME, TYPE_NAME, COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
>
COLUMN_NAME
TYPE_NAME
COLUMN_TYPE
>
COLUMN_NAME
TYPE_NAME
COLUMN_TYPE
>
----------- --------- ----------------------------
>
----------- --------- ----------------------------
>
G
GEOMETRY
GEOMETRY
>
G
GEOMETRY
GEOMETRY
>
G_S
GEOMETRY
GEOMETRY
(
1
)
>
G_S
GEOMETRY
GEOMETRY
(
GEOMETRY
,
1
)
>
P
GEOMETRY
GEOMETRY
(
POINT
)
>
P
GEOMETRY
GEOMETRY
(
POINT
)
>
P_S
GEOMETRY
GEOMETRY
(
POINT
,
1
)
>
P_S
GEOMETRY
GEOMETRY
(
POINT
,
1
)
>
PZ1
GEOMETRY
GEOMETRY
(
POINT
Z
)
>
PZ1
GEOMETRY
GEOMETRY
(
POINT
Z
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论