Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
c7830320
提交
c7830320
authored
6 年前
作者:
Evgenij Ryazanov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use new methods in EWKBUtils
上级
b796adb9
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
21 行增加
和
24 行删除
+21
-24
EWKBUtils.java
h2/src/main/org/h2/util/geometry/EWKBUtils.java
+21
-24
没有找到文件。
h2/src/main/org/h2/util/geometry/EWKBUtils.java
浏览文件 @
c7830320
...
@@ -160,7 +160,7 @@ public final class EWKBUtils {
...
@@ -160,7 +160,7 @@ public final class EWKBUtils {
private
void
writeDouble
(
double
v
)
{
private
void
writeDouble
(
double
v
)
{
v
=
toCanonicalDouble
(
v
);
v
=
toCanonicalDouble
(
v
);
Bits
.
write
Long
(
buf
,
0
,
Double
.
doubleToRawLongBits
(
v
)
);
Bits
.
write
Double
(
buf
,
0
,
v
);
output
.
write
(
buf
,
0
,
8
);
output
.
write
(
buf
,
0
,
8
);
}
}
...
@@ -204,9 +204,9 @@ public final class EWKBUtils {
...
@@ -204,9 +204,9 @@ public final class EWKBUtils {
* @return next 32-bit integer
* @return next 32-bit integer
*/
*/
int
readInt
()
{
int
readInt
()
{
int
result
=
Bits
.
readInt
(
ewkb
,
offset
);
int
result
=
bigEndian
?
Bits
.
readInt
(
ewkb
,
offset
)
:
Bits
.
readIntLE
(
ewkb
,
offset
);
offset
+=
4
;
offset
+=
4
;
return
bigEndian
?
result
:
Integer
.
reverseBytes
(
result
)
;
return
result
;
}
}
/**
/**
...
@@ -215,12 +215,9 @@ public final class EWKBUtils {
...
@@ -215,12 +215,9 @@ public final class EWKBUtils {
* @return next 64-bit floating point
* @return next 64-bit floating point
*/
*/
double
readCoordinate
()
{
double
readCoordinate
()
{
long
v
=
Bits
.
readLong
(
ewkb
,
offset
);
double
v
=
bigEndian
?
Bits
.
readDouble
(
ewkb
,
offset
)
:
Bits
.
readDoubleLE
(
ewkb
,
offset
);
offset
+=
8
;
offset
+=
8
;
if
(!
bigEndian
)
{
return
toCanonicalDouble
(
v
);
v
=
Long
.
reverseBytes
(
v
);
}
return
toCanonicalDouble
(
Double
.
longBitsToDouble
(
v
));
}
}
@Override
@Override
...
@@ -470,31 +467,31 @@ public final class EWKBUtils {
...
@@ -470,31 +467,31 @@ public final class EWKBUtils {
if
(
minX
==
maxX
&&
minY
==
maxY
)
{
if
(
minX
==
maxX
&&
minY
==
maxY
)
{
result
=
new
byte
[
21
];
result
=
new
byte
[
21
];
result
[
4
]
=
POINT
;
result
[
4
]
=
POINT
;
Bits
.
write
Long
(
result
,
5
,
Double
.
doubleToRawLongBits
(
minX
)
);
Bits
.
write
Double
(
result
,
5
,
minX
);
Bits
.
write
Long
(
result
,
13
,
Double
.
doubleToRawLongBits
(
minY
)
);
Bits
.
write
Double
(
result
,
13
,
minY
);
}
else
if
(
minX
==
maxX
||
minY
==
maxY
)
{
}
else
if
(
minX
==
maxX
||
minY
==
maxY
)
{
result
=
new
byte
[
41
];
result
=
new
byte
[
41
];
result
[
4
]
=
LINE_STRING
;
result
[
4
]
=
LINE_STRING
;
result
[
8
]
=
2
;
result
[
8
]
=
2
;
Bits
.
write
Long
(
result
,
9
,
Double
.
doubleToRawLongBits
(
minX
)
);
Bits
.
write
Double
(
result
,
9
,
minX
);
Bits
.
write
Long
(
result
,
17
,
Double
.
doubleToRawLongBits
(
minY
)
);
Bits
.
write
Double
(
result
,
17
,
minY
);
Bits
.
write
Long
(
result
,
25
,
Double
.
doubleToRawLongBits
(
maxX
)
);
Bits
.
write
Double
(
result
,
25
,
maxX
);
Bits
.
write
Long
(
result
,
33
,
Double
.
doubleToRawLongBits
(
maxY
)
);
Bits
.
write
Double
(
result
,
33
,
maxY
);
}
else
{
}
else
{
result
=
new
byte
[
93
];
result
=
new
byte
[
93
];
result
[
4
]
=
POLYGON
;
result
[
4
]
=
POLYGON
;
result
[
8
]
=
1
;
result
[
8
]
=
1
;
result
[
12
]
=
5
;
result
[
12
]
=
5
;
Bits
.
write
Long
(
result
,
13
,
Double
.
doubleToRawLongBits
(
minX
)
);
Bits
.
write
Double
(
result
,
13
,
minX
);
Bits
.
write
Long
(
result
,
21
,
Double
.
doubleToRawLongBits
(
minY
)
);
Bits
.
write
Double
(
result
,
21
,
minY
);
Bits
.
write
Long
(
result
,
29
,
Double
.
doubleToRawLongBits
(
minX
)
);
Bits
.
write
Double
(
result
,
29
,
minX
);
Bits
.
write
Long
(
result
,
37
,
Double
.
doubleToRawLongBits
(
maxY
)
);
Bits
.
write
Double
(
result
,
37
,
maxY
);
Bits
.
write
Long
(
result
,
45
,
Double
.
doubleToRawLongBits
(
maxX
)
);
Bits
.
write
Double
(
result
,
45
,
maxX
);
Bits
.
write
Long
(
result
,
53
,
Double
.
doubleToRawLongBits
(
maxY
)
);
Bits
.
write
Double
(
result
,
53
,
maxY
);
Bits
.
write
Long
(
result
,
61
,
Double
.
doubleToRawLongBits
(
maxX
)
);
Bits
.
write
Double
(
result
,
61
,
maxX
);
Bits
.
write
Long
(
result
,
69
,
Double
.
doubleToRawLongBits
(
minY
)
);
Bits
.
write
Double
(
result
,
69
,
minY
);
Bits
.
write
Long
(
result
,
77
,
Double
.
doubleToRawLongBits
(
minX
)
);
Bits
.
write
Double
(
result
,
77
,
minX
);
Bits
.
write
Long
(
result
,
85
,
Double
.
doubleToRawLongBits
(
minY
)
);
Bits
.
write
Double
(
result
,
85
,
minY
);
}
}
return
result
;
return
result
;
}
}
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论