Skip to content

Commit d0eeeaa

Browse files
authored
Merge pull request #2 from OpenSmock/dev
Ajout methode conversion vers Geometry Point
2 parents 26c9e54 + ab60541 commit d0eeeaa

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

GeoTools-Tests/CoordinatesTests.class.st

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ CoordinatesTests >> testAbsoluteCoordinates [
3838
self assert: coord altitude equals: (100 units: #meters).
3939
]
4040

41+
{ #category : #tests }
42+
CoordinatesTests >> testAbsoluteCoordinatesAsGeometryPoint [
43+
| coord |
44+
45+
coord := AbsoluteCoordinates frBrest.
46+
self assert: coord asGeometryPoint equals: (GPoint x: -4.48333 y: 48.3897).
47+
]
48+
4149
{ #category : #tests }
4250
CoordinatesTests >> testAbsoluteCoordinatesAsPoint [
4351
| coord |

GeoTools/AbsoluteCoordinates.class.st

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,16 @@ AbsoluteCoordinates >> altitudeInMeters: aNumber [
199199
altitudeInMeters := aNumber
200200
]
201201

202+
{ #category : #converting }
203+
AbsoluteCoordinates >> asGeometryPoint [
204+
205+
| coord |
206+
coord := G2DCoordinates new.
207+
coord x: self longitudeInDegrees.
208+
coord y: self latitudeInDegrees.
209+
^GPoint coordinates: coord.
210+
]
211+
202212
{ #category : #converting }
203213
AbsoluteCoordinates >> asLatLonDegreesPoint [
204214

0 commit comments

Comments
 (0)