Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modify CRSTransform to ignore datum shift(增加一个函数,可以忽略Datum Shift) #451

Merged
merged 6 commits into from
Jun 27, 2020

Conversation

scially
Copy link
Contributor

@scially scially commented Jun 8, 2020

Is this PR related to a proposed Issue?

  1. The original 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 method public boolean CRSTransform(String sourceEpsgCRSCode, String targetEpsgCRSCode, boolean lenient)
  2. Because SpatialRdd uses String sourceEpsgCRSCode to save the coordinate information, so if the user wants to consider the difference of Datum Shift, he must define CoordinateReferenceSystem to set Datum, but it needs to be changed here SaptialRdd (such as replacing sourceEpsgCRSCode with CoordinateReferenceSystem, or not considering Datum Shift directly), I need to discuss with you.
  3. In the test method onceExecutedBeforeAll of ShapefileReaderTest class, hdfsURI is 'localhost', but in some environments, Hadoop will prompt that it should be 127.0.0.1, although the effect is the same, switching to 127.0.0.1 is certainly no problem.

  1. 原来GeoSpark里的CRSTransform默认是考虑了Datum Shfit,这会导致在有些坐标转换的时候出错(比如EPSG:4326, EPSG:4490),GeoTools会抛出异常,所以我建议增加一个CRSTransform,第三个参数是boolean,运行用户忽略这个差异(因为对于精度不高的坐标转换,不用考虑这个差异的)。
  2. 因为SpatialRdd是用了 String sourceEpsgCRSCode来保存的坐标信息,所以用户如果要考虑Datum Shift差异,他应该是自己定义坐标参考系CoordinateReferenceSystem来设置Datum,但是这里就需要改动SaptialRdd了(比如用CoordinateReferenceSystem替换sourceEpsgCRSCode,或者就干脆直接不考虑Datum Shift),我就先不动,需要在和于嘉博士你讨论下。
  3. ShapefileReaderTest测试类中onceExecutedBeforeAll的测试方法里,hdfsURI'localhost',但是在一些测试环境里,Hadoop会提示应该是127.0.0.1,虽然效果是一样的,但是换成127.0.0.1肯定是没有问题的。

What changes were proposed in this PR?

  1. ShapefileReaderTest, method: onceExecutedBeforeAll
  2. SpatialRDD, method: CRSTransform

How was this patch tested?

  1. Existing test cases are enough

  1. 现有用例满足测试要求

Did this PR include necessary documentation updates?

yes, it to be updated for CRSTransform .

Copy link
Member

@jiayuasu jiayuasu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me.

@jiayuasu
Copy link
Member

jiayuasu commented Jun 9, 2020

@scially I am not sure whether we should take into account datum shift. Currently, the SQL interface also just disable the exception.

@jiayuasu jiayuasu added this to the 1.3.2 milestone Jun 9, 2020
@jiayuasu jiayuasu merged commit fe11547 into apache:master Jun 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants