Skip to content

Commit

Permalink
Merge pull request #2 from OpenSmock/dev
Browse files Browse the repository at this point in the history
Ajout methode conversion vers Geometry Point
  • Loading branch information
labordep authored Feb 13, 2024
2 parents 26c9e54 + ab60541 commit d0eeeaa
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
8 changes: 8 additions & 0 deletions GeoTools-Tests/CoordinatesTests.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ CoordinatesTests >> testAbsoluteCoordinates [
self assert: coord altitude equals: (100 units: #meters).
]

{ #category : #tests }
CoordinatesTests >> testAbsoluteCoordinatesAsGeometryPoint [
| coord |

coord := AbsoluteCoordinates frBrest.
self assert: coord asGeometryPoint equals: (GPoint x: -4.48333 y: 48.3897).
]

{ #category : #tests }
CoordinatesTests >> testAbsoluteCoordinatesAsPoint [
| coord |
Expand Down
10 changes: 10 additions & 0 deletions GeoTools/AbsoluteCoordinates.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,16 @@ AbsoluteCoordinates >> altitudeInMeters: aNumber [
altitudeInMeters := aNumber
]

{ #category : #converting }
AbsoluteCoordinates >> asGeometryPoint [

| coord |
coord := G2DCoordinates new.
coord x: self longitudeInDegrees.
coord y: self latitudeInDegrees.
^GPoint coordinates: coord.
]

{ #category : #converting }
AbsoluteCoordinates >> asLatLonDegreesPoint [

Expand Down

0 comments on commit d0eeeaa

Please sign in to comment.