From 03e69fa8ccf81c61db6c323838ccea3fb817293b Mon Sep 17 00:00:00 2001 From: Brendan Date: Tue, 13 Feb 2024 15:50:17 +0100 Subject: [PATCH 1/3] Ajout methode conversion vers Geometry Point --- GeoTools/AbsoluteCoordinates.class.st | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/GeoTools/AbsoluteCoordinates.class.st b/GeoTools/AbsoluteCoordinates.class.st index e5e3b05..a848235 100644 --- a/GeoTools/AbsoluteCoordinates.class.st +++ b/GeoTools/AbsoluteCoordinates.class.st @@ -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 [ From 66c137062d3997563189d203f895d3eea19cdfcc Mon Sep 17 00:00:00 2001 From: Brendan Date: Tue, 13 Feb 2024 15:57:33 +0100 Subject: [PATCH 2/3] Correction nommage variable --- GeoTools/AbsoluteCoordinates.class.st | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/GeoTools/AbsoluteCoordinates.class.st b/GeoTools/AbsoluteCoordinates.class.st index a848235..596b34b 100644 --- a/GeoTools/AbsoluteCoordinates.class.st +++ b/GeoTools/AbsoluteCoordinates.class.st @@ -202,11 +202,11 @@ AbsoluteCoordinates >> altitudeInMeters: aNumber [ { #category : #converting } AbsoluteCoordinates >> asGeometryPoint [ - | _coord | - _coord := G2DCoordinates new. - _coord x: self longitudeInDegrees. - _coord y: self latitudeInDegrees. - ^GPoint coordinates: _coord. + | coord | + coord := G2DCoordinates new. + coord x: self longitudeInDegrees. + coord y: self latitudeInDegrees. + ^GPoint coordinates: coord. ] { #category : #converting } From ab60541e95337d506159a563180d55ed93e5231c Mon Sep 17 00:00:00 2001 From: Brendan Date: Tue, 13 Feb 2024 16:03:32 +0100 Subject: [PATCH 3/3] Ajout test asGeometryPoint --- GeoTools-Tests/CoordinatesTests.class.st | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/GeoTools-Tests/CoordinatesTests.class.st b/GeoTools-Tests/CoordinatesTests.class.st index 0efa4e4..f13db77 100644 --- a/GeoTools-Tests/CoordinatesTests.class.st +++ b/GeoTools-Tests/CoordinatesTests.class.st @@ -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 |