Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
d1674eb2
提交
d1674eb2
authored
9月 10, 2018
作者:
Evgenij Ryazanov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Documentation and tests
上级
16536c94
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
24 行增加
和
5 行删除
+24
-5
EWKBUtils.java
h2/src/main/org/h2/util/geometry/EWKBUtils.java
+9
-1
EWKTUtils.java
h2/src/main/org/h2/util/geometry/EWKTUtils.java
+8
-1
TestGeometryUtils.java
h2/src/test/org/h2/test/unit/TestGeometryUtils.java
+6
-3
dictionary.txt
h2/src/tools/org/h2/build/doc/dictionary.txt
+1
-0
没有找到文件。
h2/src/main/org/h2/util/geometry/EWKBUtils.java
浏览文件 @
d1674eb2
...
...
@@ -26,7 +26,15 @@ import org.h2.util.geometry.GeometryUtils.DimensionSystemTarget;
import
org.h2.util.geometry.GeometryUtils.Target
;
/**
* Utilities for GEOMETRY data type.
* EWKB format support for GEOMETRY data type.
*
* <p>
* This class provides limited support of Well-known Binary Representation from
* OGC 06-103r4 plus PostGIS extensions for SRID support. This class can read
* dimension system marks in both OGC WKB and EWKB formats, but always writes
* them in EWKB format. As an addition POINT EMPTY is stored with NaN values as
* specified in <a href="http://www.geopackage.org/spec/">OGC 12-128r15</a>.
* </p>
*/
public
final
class
EWKBUtils
{
...
...
h2/src/main/org/h2/util/geometry/EWKTUtils.java
浏览文件 @
d1674eb2
...
...
@@ -29,7 +29,14 @@ import org.h2.util.geometry.GeometryUtils.DimensionSystemTarget;
import
org.h2.util.geometry.GeometryUtils.Target
;
/**
* Utilities for GEOMETRY data type.
* EWKT format support for GEOMETRY data type.
*
* <p>
* This class provides limited support of Well-known Text Representation from
* OGC 06-103r4 plus <a href=
* "https://postgis.net/docs/using_postgis_dbmanagement.html#EWKB_EWKT">PostGIS
* extension</a> for SRID support.
* </p>
*/
public
final
class
EWKTUtils
{
...
...
h2/src/test/org/h2/test/unit/TestGeometryUtils.java
浏览文件 @
d1674eb2
...
...
@@ -106,7 +106,8 @@ public class TestGeometryUtils extends TestBase {
testGeometry
(
"POINT (-1E32 1.000001)"
,
"POINT (-1E32 1.000001)"
,
"POINT (-100000000000000000000000000000000 1.000001)"
,
2
);
testGeometry
(
"POINT Z (2.7 -3 34)"
,
3
);
assertEquals
(
"POINT Z (1 2 3)"
,
EWKTUtils
.
ewkb2ewkt
(
EWKTUtils
.
ewkt2ewkb
(
"POINTz(1 2 3)"
)));
assertEquals
(
"POINT Z (1 2 3)"
,
EWKTUtils
.
ewkb2ewkt
(
EWKTUtils
.
ewkt2ewkb
(
"POINTZ(1 2 3)"
)));
assertEquals
(
"POINT Z (1 2 3)"
,
EWKTUtils
.
ewkb2ewkt
(
EWKTUtils
.
ewkt2ewkb
(
"pointz(1 2 3)"
)));
}
private
void
testLineString
()
throws
Exception
{
...
...
@@ -227,7 +228,8 @@ public class TestGeometryUtils extends TestBase {
private
void
testDimensionM
()
{
byte
[]
ewkb
=
EWKTUtils
.
ewkt2ewkb
(
"POINT M (1 2 3)"
);
assertEquals
(
"POINT M (1 2 3)"
,
EWKTUtils
.
ewkb2ewkt
(
ewkb
));
assertEquals
(
"POINT M (1 2 3)"
,
EWKTUtils
.
ewkb2ewkt
(
EWKTUtils
.
ewkt2ewkb
(
"POINTm(1 2 3)"
)));
assertEquals
(
"POINT M (1 2 3)"
,
EWKTUtils
.
ewkb2ewkt
(
EWKTUtils
.
ewkt2ewkb
(
"POINTM(1 2 3)"
)));
assertEquals
(
"POINT M (1 2 3)"
,
EWKTUtils
.
ewkb2ewkt
(
EWKTUtils
.
ewkt2ewkb
(
"pointm(1 2 3)"
)));
Point
p
=
(
Point
)
JTSUtils
.
ewkb2geometry
(
ewkb
);
CoordinateSequence
cs
=
p
.
getCoordinateSequence
();
assertEquals
(
4
,
cs
.
getDimension
());
...
...
@@ -242,7 +244,8 @@ public class TestGeometryUtils extends TestBase {
private
void
testDimensionZM
()
{
byte
[]
ewkb
=
EWKTUtils
.
ewkt2ewkb
(
"POINT ZM (1 2 3 4)"
);
assertEquals
(
"POINT ZM (1 2 3 4)"
,
EWKTUtils
.
ewkb2ewkt
(
ewkb
));
assertEquals
(
"POINT ZM (1 2 3 4)"
,
EWKTUtils
.
ewkb2ewkt
(
EWKTUtils
.
ewkt2ewkb
(
"POINTzm(1 2 3 4)"
)));
assertEquals
(
"POINT ZM (1 2 3 4)"
,
EWKTUtils
.
ewkb2ewkt
(
EWKTUtils
.
ewkt2ewkb
(
"POINTZM(1 2 3 4)"
)));
assertEquals
(
"POINT ZM (1 2 3 4)"
,
EWKTUtils
.
ewkb2ewkt
(
EWKTUtils
.
ewkt2ewkb
(
"pointzm(1 2 3 4)"
)));
Point
p
=
(
Point
)
JTSUtils
.
ewkb2geometry
(
ewkb
);
CoordinateSequence
cs
=
p
.
getCoordinateSequence
();
assertEquals
(
4
,
cs
.
getDimension
());
...
...
h2/src/tools/org/h2/build/doc/dictionary.txt
浏览文件 @
d1674eb2
...
...
@@ -794,3 +794,4 @@ minxf maxxf minyf maxyf bminxf bmaxxf bminyf bmaxyf
minxd maxxd minyd maxyd bminxd bmaxxd bminyd bmaxyd
interior envelopes multilinestring multipoint packed exterior normalization awkward determination subgeometries
xym normalizes coord setz xyzm geometrycollection multipolygon mixup rings polygons rejection finite
pointzm pointz pointm
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论