-
Notifications
You must be signed in to change notification settings - Fork 18
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
long to int coordinates, refactoring #395
Conversation
There are some minor code cleanups in e.g. MapReducer
I could revert this, but I think there a reasonable, let me know. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At first glance this one looks good, I'll take a deeper look this afternoon. Can you in the meantime add a line or two to the changelog please, so this is ready to be merged?
Sure, thank you. Please while you do the review, have a deeper look/critical eye on the changes within the utils/geometry packages. As there are not just search&replace changes. The test run through, though. Also I'm not happy with the naming of the helper function |
700ee0d
to
cf6e76a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already some general remarks (mostly inline, and one additional one below).
- couldn't some of the parameters of the
ZGrid
class also be downgraded toint
fromlong
(e.g. as in… int denormalizeLon(int lon) { …
)?
Please while you do the review, have a deeper look/critical eye on the changes within the utils/geometry packages. As there are not just search&replace changes.
I'm still taking a deeper look at these parts right now.
.../src/main/java/org/heigit/ohsome/oshdb/tool/importer/transform/oshdb/TransformOSHEntity.java
Outdated
Show resolved
Hide resolved
oshdb/src/main/java/org/heigit/ohsome/oshdb/impl/osh/OSHEntityImpl.java
Outdated
Show resolved
Hide resolved
oshdb-util/src/main/java/org/heigit/ohsome/oshdb/util/geometry/OSHDBGeometryBuilder.java
Outdated
Show resolved
Hide resolved
oshdb-etl/src/main/java/org/heigit/ohsome/oshdb/tool/importer/transform/TransformerNode.java
Show resolved
Hide resolved
oshdb/src/main/java/org/heigit/ohsome/oshdb/util/bytearray/ByteArrayOutputWrapper.java
Show resolved
Hide resolved
oshdb/src/test/java/org/heigit/ohsome/oshdb/osm/OSMNodeTest.java
Outdated
Show resolved
Hide resolved
…transform/oshdb/TransformOSHEntity.java Co-authored-by: Martin Raifer <martin.raifer@heigit.org>
…Impl.java Co-authored-by: Martin Raifer <martin.raifer@heigit.org>
I agree that |
I renamed |
This PR change the internal representation of the "osm-coordinates" from a
long
toint
data-type.It mainly affects the
OSHDBBoundingBox
class and a newOSMCoordinates
helper class .The OSHDBBoundingBox had 3 construtors with different data-types as arguments:
double
type arguments, lon/lat wgs48 representation e.g. 8.6724, 49.3988int
type arguments, also lon/lat wgs48 but omitting the decimal parts, e.g. 8, 49long
type arguments, the interal "osm-coordinates", e.g. 86724000, 493988000For better distinction, new constructor functions are introduced,
bboxLonLatCoordinates
, for lon/lat coordinatesbboxOSMCoordinates
, for "osm-coordinates"And some helper methods
OSMCoordinates.toDouble
-> from "osm-coordinate" to lon/lat coordinateOSMCoordinates.toOSM
-> from lon/lat to "osm-coordinate"The refactoring where mostly done with search&replace like
OSHDBGeometryBuilder
also got a new helper methodgetCoordinate
which converts a "osm-coordinates" intojts.Coordinates
other refactorings
OSHEntity
getNodes
,getWays
don't throw an exception any more!OSHDBHandler
The
OSHDBHandler
class in the etl module got some refactoring, mainly to get rid of duplicated codes sonar-lint warnings. For than a newOSHDBHandlerTest
class were written.Corresponding issue
Closes #320
Checklist
I have made corresponding changes to the documentationI have adjusted the examples or created an issue in the corresponding repositoryI have adjusted the benchmark or created an issue in the corresponding repository