modify CRSTransform to ignore datum shift(增加一个函数,可以忽略Datum Shift) #451
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Is this PR related to a proposed Issue?
CRSTransform
considering the datum shift between different coordinate systems, but for some coordinate transformations with low accuracy , sometimes this parameter does not need to be considered, so we add methodpublic boolean CRSTransform(String sourceEpsgCRSCode, String targetEpsgCRSCode, boolean lenient)
SpatialRdd
usesString sourceEpsgCRSCode
to save the coordinate information, so if the user wants to consider the difference ofDatum Shift
, he must defineCoordinateReferenceSystem
to set Datum, but it needs to be changed hereSaptialRdd
(such as replacingsourceEpsgCRSCode
withCoordinateReferenceSystem
, or not considering Datum Shift directly), I need to discuss with you.onceExecutedBeforeAll
ofShapefileReaderTest
class,hdfsURI
is'localhost'
, but in some environments, Hadoop will prompt that it should be127.0.0.1
, although the effect is the same, switching to127.0.0.1
is certainly no problem.CRSTransform
默认是考虑了Datum Shfit,这会导致在有些坐标转换的时候出错(比如EPSG:4326, EPSG:4490),GeoTools会抛出异常,所以我建议增加一个CRSTransform
,第三个参数是boolean,运行用户忽略这个差异(因为对于精度不高的坐标转换,不用考虑这个差异的)。SpatialRdd
是用了String sourceEpsgCRSCode
来保存的坐标信息,所以用户如果要考虑Datum Shift
差异,他应该是自己定义坐标参考系CoordinateReferenceSystem
来设置Datum,但是这里就需要改动SaptialRdd
了(比如用CoordinateReferenceSystem
替换sourceEpsgCRSCode
,或者就干脆直接不考虑Datum Shift),我就先不动,需要在和于嘉博士你讨论下。ShapefileReaderTest
测试类中onceExecutedBeforeAll
的测试方法里,hdfsURI
是'localhost'
,但是在一些测试环境里,Hadoop会提示应该是127.0.0.1
,虽然效果是一样的,但是换成127.0.0.1
肯定是没有问题的。What changes were proposed in this PR?
ShapefileReaderTest
, method:onceExecutedBeforeAll
SpatialRDD
, method:CRSTransform
How was this patch tested?
Did this PR include necessary documentation updates?
yes, it to be updated for
CRSTransform
.