From 83503cb04ac756f69fd692bf2dc08e92f2fa84a5 Mon Sep 17 00:00:00 2001 From: Norbert Hartl Date: Tue, 10 Dec 2024 13:45:40 +0100 Subject: [PATCH] Remove the usage of braceWith:with: for pharo 12 compatibility --- OGC-Core/ManifestOGCCore.class.st | 8 +- OGC-Core/OGCCurve.class.st | 43 ++++---- OGC-Core/OGCEmptySet.class.st | 13 +-- OGC-Core/OGCFeature.class.st | 31 +++--- OGC-Core/OGCFeatureCollection.class.st | 35 +++--- OGC-Core/OGCGeometry.class.st | 101 +++++++++--------- OGC-Core/OGCGeometryCollection.class.st | 27 ++--- .../OGCIncorrectNumberOfPointsError.class.st | 16 +-- OGC-Core/OGCLine.class.st | 15 +-- OGC-Core/OGCLineString.class.st | 19 ++-- OGC-Core/OGCLinearRing.class.st | 13 +-- OGC-Core/OGCMeasureReferenceSystem.class.st | 7 +- OGC-Core/OGCMultiCurve.class.st | 17 +-- OGC-Core/OGCMultiLineString.class.st | 11 +- OGC-Core/OGCMultiPoint.class.st | 21 ++-- OGC-Core/OGCMultiPolygon.class.st | 11 +- OGC-Core/OGCMultiSurface.class.st | 9 +- OGC-Core/OGCNotALinearRingError.class.st | 18 ++-- OGC-Core/OGCObject.class.st | 21 ++-- OGC-Core/OGCPoint.class.st | 81 +++++++------- OGC-Core/OGCPolygon.class.st | 31 +++--- OGC-Core/OGCPolyhedralSurface.class.st | 19 ++-- OGC-Core/OGCReferenceSystem.class.st | 13 +-- OGC-Core/OGCSpatialReferenceSystem.class.st | 7 +- OGC-Core/OGCSurface.class.st | 25 ++--- OGC-Core/OGCTIN.class.st | 7 +- OGC-Core/OGCTriangle.class.st | 15 +-- OGC-Core/package.st | 2 +- 28 files changed, 333 insertions(+), 303 deletions(-) diff --git a/OGC-Core/ManifestOGCCore.class.st b/OGC-Core/ManifestOGCCore.class.st index 2158095..0f11d01 100644 --- a/OGC-Core/ManifestOGCCore.class.st +++ b/OGC-Core/ManifestOGCCore.class.st @@ -2,7 +2,9 @@ Implementation of Simple Feature Access Standard from OGC: https://www.ogc.org/standards/sfa " Class { - #name : #ManifestOGCCore, - #superclass : #PackageManifest, - #category : #'OGC-Core-Manifest' + #name : 'ManifestOGCCore', + #superclass : 'PackageManifest', + #category : 'OGC-Core-Manifest', + #package : 'OGC-Core', + #tag : 'Manifest' } diff --git a/OGC-Core/OGCCurve.class.st b/OGC-Core/OGCCurve.class.st index e7506f1..f295824 100644 --- a/OGC-Core/OGCCurve.class.st +++ b/OGC-Core/OGCCurve.class.st @@ -13,78 +13,79 @@ Instanciation: `OGCCurve class>>#withPoints:` " Class { - #name : #OGCCurve, - #superclass : #OGCGeometry, + #name : 'OGCCurve', + #superclass : 'OGCGeometry', #instVars : [ 'points' ], - #category : #'OGC-Core' + #category : 'OGC-Core', + #package : 'OGC-Core' } -{ #category : #accessing } +{ #category : 'accessing' } OGCCurve class >> geometryType [ ^ 'Curve' ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } OGCCurve class >> withPoints: aCollectionOfPoints [ ^ self new points: aCollectionOfPoints ] -{ #category : #testing } +{ #category : 'testing' } OGCCurve >> = anotherCurve [ ^ (self points) = (anotherCurve points) ] -{ #category : #basic } +{ #category : 'basic' } OGCCurve >> boundary [ "The boundary of a non-closed Curve consists of its two end Points. The boundary of a closed Curve is empty." self isClosed ifFalse: [ ^ self class withPoints: (OrderedCollection with: (self points allButLast last) with: self endPoint) ] ifTrue: [ ^ OGCEmptySet new ] ] -{ #category : #accessing } +{ #category : 'accessing' } OGCCurve >> coordinates [ ^ self points ] -{ #category : #accessing } +{ #category : 'accessing' } OGCCurve >> coordinates: aCollection [ self points: (aCollection collect: [ :each | OGCPoint xy: each ]) ] -{ #category : #style } +{ #category : 'style' } OGCCurve >> defaultFillColor [ ^ 'transparent' ] -{ #category : #accessing } +{ #category : 'accessing' } OGCCurve >> dimension [ "The inherent dimension of this geometric object, which must be less than or equal to the coordinate dimension." ^ 1 ] -{ #category : #accessing } +{ #category : 'accessing' } OGCCurve >> endPoint [ ^ points last ] -{ #category : #accessing } +{ #category : 'accessing' } OGCCurve >> isClosed [ ^ self startPoint = self endPoint ] -{ #category : #testing } +{ #category : 'testing' } OGCCurve >> isLine [ ^ points size = 2 ] -{ #category : #testing } +{ #category : 'testing' } OGCCurve >> isRing [ ^ self isClosed & self isSimple ] -{ #category : #basic } +{ #category : 'basic' } OGCCurve >> isSimple [ "A Curve is simple if it does not pass through the same Point twice with the possible exception of the two end points" @@ -93,23 +94,23 @@ points" ^ (points size == setSize) ifFalse: [ (setSize == (points size - 1)) and: (self isClosed) ] ] -{ #category : #accessing } +{ #category : 'accessing' } OGCCurve >> length [ "The length of this Curve in its associated spatial reference" self subclassResponsibility ] -{ #category : #accessing } +{ #category : 'accessing' } OGCCurve >> points [ ^ points ] -{ #category : #accessing } +{ #category : 'accessing' } OGCCurve >> points: anObject [ points := anObject ] -{ #category : #basic } +{ #category : 'basic' } OGCCurve >> rectangularEnvelope [ " Returns the minimal rectangle which contains all features " | allRectangularEnvelopes | @@ -117,7 +118,7 @@ OGCCurve >> rectangularEnvelope [ ^ allRectangularEnvelopes reduce: [ :rect1 :rect2 | rect1 merge: rect2 ] ] -{ #category : #accessing } +{ #category : 'accessing' } OGCCurve >> startPoint [ ^ points first ] diff --git a/OGC-Core/OGCEmptySet.class.st b/OGC-Core/OGCEmptySet.class.st index 1547aac..4f8698c 100644 --- a/OGC-Core/OGCEmptySet.class.st +++ b/OGC-Core/OGCEmptySet.class.st @@ -2,22 +2,23 @@ I am the empty OGCGeometry object, so `isEmpty = true` " Class { - #name : #OGCEmptySet, - #superclass : #OGCGeometry, - #category : #'OGC-Core' + #name : 'OGCEmptySet', + #superclass : 'OGCGeometry', + #category : 'OGC-Core', + #package : 'OGC-Core' } -{ #category : #accessing } +{ #category : 'accessing' } OGCEmptySet class >> geometryType [ ^ 'Empty set' ] -{ #category : #testing } +{ #category : 'testing' } OGCEmptySet >> = anotherObject [ ^ self isEmpty = anotherObject isEmpty ] -{ #category : #basic } +{ #category : 'basic' } OGCEmptySet >> isEmpty [ ^ true ] diff --git a/OGC-Core/OGCFeature.class.st b/OGC-Core/OGCFeature.class.st index c298134..736c9c7 100644 --- a/OGC-Core/OGCFeature.class.st +++ b/OGC-Core/OGCFeature.class.st @@ -7,73 +7,74 @@ I contain: - (if needed) an id " Class { - #name : #OGCFeature, - #superclass : #OGCObject, + #name : 'OGCFeature', + #superclass : 'OGCObject', #instVars : [ 'geometry', 'properties', 'id' ], - #category : #'OGC-Core' + #category : 'OGC-Core', + #package : 'OGC-Core' } -{ #category : #accessing } +{ #category : 'accessing' } OGCFeature class >> geometry: aOGCGeometry [ ^ self new geometry: aOGCGeometry ] -{ #category : #style } +{ #category : 'style' } OGCFeature >> applyStyle: aStyleDictionary [ self geometry applyStyle: aStyleDictionary ] -{ #category : #style } +{ #category : 'style' } OGCFeature >> applyStyle: aStyleDictionary ifFeature: aBlock [ " apply the given style to features which respect given block closure" (aBlock value: self) ifTrue: [ self applyStyle: aStyleDictionary ] ] -{ #category : #converting } +{ #category : 'converting' } OGCFeature >> asFeaturesCollection [ ^ OGCFeatureCollection new features: (Array with: self) ] -{ #category : #'methods analysis' } +{ #category : 'methods analysis' } OGCFeature >> distance: anotherFeature [ ^ self geometry distance: anotherFeature geometry ] -{ #category : #accessing } +{ #category : 'accessing' } OGCFeature >> geometry [ ^ geometry ] -{ #category : #accessing } +{ #category : 'accessing' } OGCFeature >> geometry: anObject [ geometry := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } OGCFeature >> id [ ^ id ] -{ #category : #accessing } +{ #category : 'accessing' } OGCFeature >> id: aStringIdOrInteger [ id := aStringIdOrInteger ] -{ #category : #accessing } +{ #category : 'accessing' } OGCFeature >> properties [ ^ properties ifNil: [ ^ properties := Dictionary new ] ] -{ #category : #accessing } +{ #category : 'accessing' } OGCFeature >> properties: aDictionary [ properties := aDictionary ] -{ #category : #basic } +{ #category : 'basic' } OGCFeature >> rectangularEnvelope [ " Returns the minimal rectangle which contains all features " ^ self geometry rectangularEnvelope diff --git a/OGC-Core/OGCFeatureCollection.class.st b/OGC-Core/OGCFeatureCollection.class.st index d1a42e9..48eba4e 100644 --- a/OGC-Core/OGCFeatureCollection.class.st +++ b/OGC-Core/OGCFeatureCollection.class.st @@ -6,21 +6,22 @@ I represent the GeoJSON element called FeatureCollection which gathers: Instanciation: `OGCFeatureCollection class>>#features:` " Class { - #name : #OGCFeatureCollection, - #superclass : #OGCObject, + #name : 'OGCFeatureCollection', + #superclass : 'OGCObject', #instVars : [ 'features', 'properties' ], - #category : #'OGC-Core' + #category : 'OGC-Core', + #package : 'OGC-Core' } -{ #category : #accessing } +{ #category : 'accessing' } OGCFeatureCollection class >> features: aCollectionOfFeatures [ ^ self new features: aCollectionOfFeatures ] -{ #category : #adding } +{ #category : 'adding' } OGCFeatureCollection >> addFeaturePropertyKey: aKey withData: aDictionary withIdentityKey: anIdentityKey [ " add a property to the properties of features, based on a dictionary which uses a join key to identify concerned feature = identity key" @@ -30,7 +31,7 @@ OGCFeatureCollection >> addFeaturePropertyKey: aKey withData: aDictionary withId (self features at: index) properties add: (Association key: aKey value: value) ] ] -{ #category : #style } +{ #category : 'style' } OGCFeatureCollection >> applyContinuousColorationOn: aDataKey withColor: aColorName [ | maxValue minValue | maxValue := (self features collect: [ :aFeature | (aFeature properties at: aDataKey) asNumber ]) max. @@ -49,12 +50,12 @@ OGCFeatureCollection >> applyContinuousColorationOn: aDataKey withColor: aColorN ]. ] -{ #category : #style } +{ #category : 'style' } OGCFeatureCollection >> applyContinuousColorationOn: aDataKey withFeatureData: aCSVArray withAssociateKey: aDataAssociateKey withColor: aColorName [ ^ self applyContinuousColorationOn: aDataKey withFeatureData: aCSVArray withAssociateKey: aDataAssociateKey withEqualityCondition: [ :a :b | a = b ] withColor: aColorName ] -{ #category : #style } +{ #category : 'style' } OGCFeatureCollection >> applyContinuousColorationOn: aDataKey withFeatureData: aCSVArray withAssociateKey: aDataAssociateKey withEqualityCondition: aBlock withColor: aColorName [ | indexKey indexAssociateKey dataDictionary | " 1. organize data " @@ -72,49 +73,49 @@ OGCFeatureCollection >> applyContinuousColorationOn: aDataKey withFeatureData: a self applyContinuousColorationOn: aDataKey withColor: aColorName ] -{ #category : #style } +{ #category : 'style' } OGCFeatureCollection >> applyStyle: aStyleDictionary [ self features do: [ :aFeature | aFeature applyStyle: aStyleDictionary ] ] -{ #category : #style } +{ #category : 'style' } OGCFeatureCollection >> applyStyle: aStyleDictionary ifFeature: aBlock [ self features do: [ :eachFeature | eachFeature applyStyle: aStyleDictionary ifFeature: aBlock ] ] -{ #category : #converting } +{ #category : 'converting' } OGCFeatureCollection >> asFeaturesCollection [ ^ self ] -{ #category : #accessing } +{ #category : 'accessing' } OGCFeatureCollection >> detectFeatureIndexWithPropertyKey: aKey andValue: aValue [ ^ self features detectIndex: [ :aFeature | aFeature properties includesAssociation: (Association key: aKey value: aValue) ] ] -{ #category : #accessing } +{ #category : 'accessing' } OGCFeatureCollection >> features [ ^ features ] -{ #category : #accessing } +{ #category : 'accessing' } OGCFeatureCollection >> features: aCollection [ features := aCollection ] -{ #category : #accessing } +{ #category : 'accessing' } OGCFeatureCollection >> initialize [ super initialize. features := OrderedCollection new. properties := Dictionary new. ] -{ #category : #accessing } +{ #category : 'accessing' } OGCFeatureCollection >> properties [ ^ properties ] -{ #category : #accessing } +{ #category : 'accessing' } OGCFeatureCollection >> rectangularEnvelope [ " Returns the minimal rectangle which contains all features " | allRectangularEnvelopes | diff --git a/OGC-Core/OGCGeometry.class.st b/OGC-Core/OGCGeometry.class.st index be6dc2d..a8d44c5 100644 --- a/OGC-Core/OGCGeometry.class.st +++ b/OGC-Core/OGCGeometry.class.st @@ -20,56 +20,57 @@ Each coordinate shallbe unambiguously associated to a coordinate reference syste All Geometry classes described in this standard are defined so that instances of Geometry are topologically closed, i.e. all represented geometries include their boundary as point sets. This does not affect their " Class { - #name : #OGCGeometry, - #superclass : #OGCObject, + #name : 'OGCGeometry', + #superclass : 'OGCObject', #instVars : [ 'spatialReferenceSystem', 'measureReferenceSystems', 'style' ], - #category : #'OGC-Core' + #category : 'OGC-Core', + #package : 'OGC-Core' } -{ #category : #accessing } +{ #category : 'accessing' } OGCGeometry class >> geometryType [ self subclassResponsibility ] -{ #category : #testing } +{ #category : 'testing' } OGCGeometry class >> isAbstract [ ^ self == OGCGeometry ] -{ #category : #testing } +{ #category : 'testing' } OGCGeometry >> = anotherGeometry [ self subclassResponsibility ] -{ #category : #basic } +{ #category : 'basic' } OGCGeometry >> SRID [ "Returns the Spatial Reference System ID for this geometric object. This will normally be a foreign key to an index of reference systems stored in either the same or some other datastore." self subclassResponsibility ] -{ #category : #style } +{ #category : 'style' } OGCGeometry >> applyStyle: aStyleDictionary [ aStyleDictionary keysDo: [ :aKey | self style at: aKey put: (aStyleDictionary at: aKey) ] ] -{ #category : #converting } +{ #category : 'converting' } OGCGeometry >> asFeature [ ^ OGCFeature new geometry: self ] -{ #category : #converting } +{ #category : 'converting' } OGCGeometry >> asFeaturesCollection [ | aFeature | aFeature := OGCFeature new geometry: self. ^ aFeature asFeaturesCollection ] -{ #category : #basic } +{ #category : 'basic' } OGCGeometry >> boundary [ "Geometry — Returns the closure of the combinatorial boundary of this geometric object (Reference [1], section 3.12.2). Because the result of this function is a closure, and hence topologically @@ -78,19 +79,19 @@ section 3.12.2). The return type is integer, but is interpreted as Boolean, TRUE self subclassResponsibility ] -{ #category : #'methods analysis' } +{ #category : 'methods analysis' } OGCGeometry >> buffer: aDistance [ "Returns a geometric object that represents all Points whose distance from this geometric object is less than or equal to distance." self subclassResponsibility ] -{ #category : #testing } +{ #category : 'testing' } OGCGeometry >> contains: anotherGeometry [ self subclassResponsibility ] -{ #category : #'methods analysis' } +{ #category : 'methods analysis' } OGCGeometry >> convexHull [ "Returns a geometric object that represents the convex hull of this geometric object. Convex hulls, being dependent on straight lines, can be accurately represented in linear interpolations @@ -99,60 +100,60 @@ for any geometry restricted to linear interpolations." ] -{ #category : #accessing } +{ #category : 'accessing' } OGCGeometry >> coordinates [ self subclassResponsibility ] -{ #category : #accessing } +{ #category : 'accessing' } OGCGeometry >> coordinates: newCoordinates [ self subclassResponsibility ] -{ #category : #testing } +{ #category : 'testing' } OGCGeometry >> crosses: anotherGeometry [ self subclassResponsibility ] -{ #category : #style } +{ #category : 'style' } OGCGeometry >> defaultFillColor [ ^ 'red' ] -{ #category : #style } +{ #category : 'style' } OGCGeometry >> defaultFillOpacity [ ^ '0' ] -{ #category : #style } +{ #category : 'style' } OGCGeometry >> defaultStrokeColor [ ^ 'red' ] -{ #category : #style } +{ #category : 'style' } OGCGeometry >> defaultStrokeWidth [ ^ '2' ] -{ #category : #'methods analysis' } +{ #category : 'methods analysis' } OGCGeometry >> difference: anotherGeometry [ "Returns a geometric object that represents the Point set difference of this geometric object with anotherGeometry." self subclassResponsibility ] -{ #category : #basic } +{ #category : 'basic' } OGCGeometry >> dimension [ "The inherent dimension of this geometric object, which must be less than or equal to the coordinate dimension." self subclassResponsibility ] -{ #category : #testing } +{ #category : 'testing' } OGCGeometry >> disjoint: anotherGeometry [ self subclassResponsibility ] -{ #category : #'methods analysis' } +{ #category : 'methods analysis' } OGCGeometry >> distance: anotherGeometry [ "Returns the shortest distance between any two Points in the two geometric objects as calculated in the spatial reference system of this geometric object. Because the @@ -161,7 +162,7 @@ between these 2 points is the returned distance between their geometric objects. self subclassResponsibility ] -{ #category : #basic } +{ #category : 'basic' } OGCGeometry >> envelope [ "The minimum bounding box for this Geometry, returned as a Geometry. The polygon is defined by the corner points of the bounding box [(MINX, MINY), (MAXX, MINY), (MAXX, MAXY), @@ -171,46 +172,46 @@ cases, this coordinate will be outside the range of validity for the Spatial Ref self subclassResponsibility ] -{ #category : #basic } +{ #category : 'basic' } OGCGeometry >> geometryType [ "Returns the name of the instantiable subtype of Geometry of which this geometric object is an instantiable member" ^ self class geometryType ] -{ #category : #initialization } +{ #category : 'initialization' } OGCGeometry >> initialize [ spatialReferenceSystem := OGCGeometricProjection ] -{ #category : #'methods analysis' } +{ #category : 'methods analysis' } OGCGeometry >> intersection: anotherGeometry [ "Returns a geometric object that represents the Point set intersection of this geometric object with anotherGeometry." self subclassResponsibility ] -{ #category : #testing } +{ #category : 'testing' } OGCGeometry >> intersects: anotherGeometry [ self subclassResponsibility ] -{ #category : #basic } +{ #category : 'basic' } OGCGeometry >> is3D [ self subclassResponsibility ] -{ #category : #testing } +{ #category : 'testing' } OGCGeometry >> isEmpty [ self subclassResponsibility ] -{ #category : #basic } +{ #category : 'basic' } OGCGeometry >> isMeasured [ "Returns 1 (TRUE) if this geometric object has m coordinate values." self subclassResponsibility ] -{ #category : #basic } +{ #category : 'basic' } OGCGeometry >> isSimple [ "Returns 1 (TRUE) if this geometric object has no anomalous geometric points, such as self intersection or self tangency. The description of each instantiable geometric class will include the @@ -219,14 +220,14 @@ integer, but is interpreted as Boolean, TRUE=1, FALSE=0." self subclassResponsibility ] -{ #category : #testing } +{ #category : 'testing' } OGCGeometry >> locateAlong: mValue [ "Returns a derived geometry collection value that matches the specified m coordinate value. See Subclause 6.1.2.6 “Measures on Geometry” for more details" self subclassResponsibility ] -{ #category : #testing } +{ #category : 'testing' } OGCGeometry >> locateBetween: mStart and: mEnd [ "Returns a derived geometry collection value that matches the specified range of m coordinate values inclusively. See Subclause 6.1.2.6 “Measures on @@ -234,18 +235,18 @@ Geometry” for more details." self subclassResponsibility ] -{ #category : #testing } +{ #category : 'testing' } OGCGeometry >> overlaps: anotherGeometry [ self subclassResponsibility ] -{ #category : #basic } +{ #category : 'basic' } OGCGeometry >> rectangularEnvelope [ "Returns the minimal rectangle which contains the geometry" self subclassResponsibility ] -{ #category : #testing } +{ #category : 'testing' } OGCGeometry >> relate: anotherGeometry [ "Returns 1 (TRUE) if this geometric object is spatially related to anotherGeometry by testing for intersections between the interior, @@ -254,23 +255,23 @@ This returns FALSE if all the tested intersections are empty except exterior (th self subclassResponsibility ] -{ #category : #accessing } +{ #category : 'accessing' } OGCGeometry >> spatialReferenceSystem [ ^ spatialReferenceSystem ] -{ #category : #accessing } +{ #category : 'accessing' } OGCGeometry >> style [ ^ style ifNil: [ ^ style := Dictionary new ] ] -{ #category : #accessing } +{ #category : 'accessing' } OGCGeometry >> style: aDictionaryWithStyleSpecs [ style := aDictionaryWithStyleSpecs ] -{ #category : #style } +{ #category : 'style' } OGCGeometry >> styleFillColor [ | color colorObject | color := self style at: 'fill' ifAbsent: [ self defaultFillColor ]. @@ -278,47 +279,47 @@ OGCGeometry >> styleFillColor [ ^ colorObject alpha: self styleFillOpacity ] -{ #category : #style } +{ #category : 'style' } OGCGeometry >> styleFillOpacity [ | fillOpacity | fillOpacity := self style at: 'fill-opacity' ifAbsent: [ self defaultFillOpacity ]. ^ (fillOpacity asNumber) ifNil: [ ^ self defaultFillOpacity asNumber ] ] -{ #category : #style } +{ #category : 'style' } OGCGeometry >> styleStrokeColor [ | color | color := self style at: 'stroke' ifAbsent: [ self defaultStrokeColor ]. ^ (Color named: color) ifNil: [ ^ Color named: self defaultStrokeColor ] ] -{ #category : #style } +{ #category : 'style' } OGCGeometry >> styleStrokeWidth [ | width | width := self style at: 'stroke-width' ifAbsent: [ self defaultStrokeWidth ]. ^ (width asNumber) ifNil: [ ^ self defaultStrokeWidth asNumber ] ] -{ #category : #'methods analysis' } +{ #category : 'methods analysis' } OGCGeometry >> symDifference: anotherGeometry [ "Returns a geometric object that represents the Point set symmetric difference of this geometric object with anotherGeometry." self subclassResponsibility ] -{ #category : #testing } +{ #category : 'testing' } OGCGeometry >> touches: anotherGeometry [ self subclassResponsibility ] -{ #category : #'methods analysis' } +{ #category : 'methods analysis' } OGCGeometry >> union: anotherGeometry [ "Returns a geometric object that represents the Point set union of this geometric object with anotherGeometry." self subclassResponsibility ] -{ #category : #testing } +{ #category : 'testing' } OGCGeometry >> within: anotherGeometry [ self subclassResponsibility ] diff --git a/OGC-Core/OGCGeometryCollection.class.st b/OGC-Core/OGCGeometryCollection.class.st index eab5247..23f9ffd 100644 --- a/OGC-Core/OGCGeometryCollection.class.st +++ b/OGC-Core/OGCGeometryCollection.class.st @@ -12,15 +12,16 @@ GeometryCollection places no other constraints on its elements. Subclasses of GeometryCollection may restrict membership based on dimension and may also place other constraints on the degree of spatial overlap between elements. " Class { - #name : #OGCGeometryCollection, - #superclass : #OGCGeometry, + #name : 'OGCGeometryCollection', + #superclass : 'OGCGeometry', #instVars : [ 'geometries' ], - #category : #'OGC-Core' + #category : 'OGC-Core', + #package : 'OGC-Core' } -{ #category : #accessing } +{ #category : 'accessing' } OGCGeometryCollection class >> geometries: aCollectionOfGeometries [ | classToGenerate | classToGenerate := self. @@ -33,50 +34,50 @@ OGCGeometryCollection class >> geometries: aCollectionOfGeometries [ ^ classToGenerate new geometries: aCollectionOfGeometries ] -{ #category : #testing } +{ #category : 'testing' } OGCGeometryCollection class >> isAbstract [ ^ self == OGCGeometryCollection ] -{ #category : #testing } +{ #category : 'testing' } OGCGeometryCollection >> = anotherMultiPoint [ ^ self geometries asSet = anotherMultiPoint geometries asSet ] -{ #category : #accessing } +{ #category : 'accessing' } OGCGeometryCollection >> coordinates [ ^ geometries collect: #coordinates ] -{ #category : #basic } +{ #category : 'basic' } OGCGeometryCollection >> dimension [ ^ geometries sorted: [ :e1 :e2 | e1 dimension > e2 dimension ] first ] -{ #category : #accessing } +{ #category : 'accessing' } OGCGeometryCollection >> geometries [ ^ geometries ] -{ #category : #accessing } +{ #category : 'accessing' } OGCGeometryCollection >> geometries: anObject [ geometries := anObject. geometries do: [ :each | each style: self style ]. ] -{ #category : #accessing } +{ #category : 'accessing' } OGCGeometryCollection >> geometryN: index [ "Returns the Nth geometry in this GeometryCollection" ^ geometries at: index ] -{ #category : #accessing } +{ #category : 'accessing' } OGCGeometryCollection >> numGeometries [ "cReturns the number of geometries in this GeometryCollection" ^ geometries size ] -{ #category : #basic } +{ #category : 'basic' } OGCGeometryCollection >> rectangularEnvelope [ " Returns the minimal rectangle which contains all features " | allRectangularEnvelopes | diff --git a/OGC-Core/OGCIncorrectNumberOfPointsError.class.st b/OGC-Core/OGCIncorrectNumberOfPointsError.class.st index 579ad69..24bfec5 100644 --- a/OGC-Core/OGCIncorrectNumberOfPointsError.class.st +++ b/OGC-Core/OGCIncorrectNumberOfPointsError.class.st @@ -2,34 +2,36 @@ Error used when too many points are given to instanciate a Line. " Class { - #name : #OGCIncorrectNumberOfPointsError, - #superclass : #Error, + #name : 'OGCIncorrectNumberOfPointsError', + #superclass : 'Error', #instVars : [ 'size' ], - #category : #'OGC-Core-Errors' + #category : 'OGC-Core-Errors', + #package : 'OGC-Core', + #tag : 'Errors' } -{ #category : #signalling } +{ #category : 'signalling' } OGCIncorrectNumberOfPointsError class >> signalWith: anInteger [ ^ self new size: anInteger; signal ] -{ #category : #accessing } +{ #category : 'accessing' } OGCIncorrectNumberOfPointsError >> messageText [ "Overwritten to initialiaze the message text to a standard text if it has not yet been set" ^ messageText ifNil: [ messageText := self standardMessageText ] ] -{ #category : #accessing } +{ #category : 'accessing' } OGCIncorrectNumberOfPointsError >> size: anInteger [ size := anInteger ] -{ #category : #printing } +{ #category : 'printing' } OGCIncorrectNumberOfPointsError >> standardMessageText [ "Generate a standard textual description" diff --git a/OGC-Core/OGCLine.class.st b/OGC-Core/OGCLine.class.st index 65a6f60..ed1c907 100644 --- a/OGC-Core/OGCLine.class.st +++ b/OGC-Core/OGCLine.class.st @@ -8,29 +8,30 @@ A Line is a LineString with exactly 2 Points = a segment. Instanciation: `OGCLine class>>#withPoints:` " Class { - #name : #OGCLine, - #superclass : #OGCLineString, - #category : #'OGC-Core' + #name : 'OGCLine', + #superclass : 'OGCLineString', + #category : 'OGC-Core', + #package : 'OGC-Core' } -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } OGCLine class >> errorIncorrectNumberOfPoints: anInteger [ OGCIncorrectNumberOfPointsError signalWith: anInteger ] -{ #category : #accessing } +{ #category : 'accessing' } OGCLine class >> geometryType [ ^ 'Line' ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } OGCLine class >> withPoints: aCollectionOfPoints [ (aCollectionOfPoints size = 2) ifTrue: [ ^ self new points: aCollectionOfPoints ] ifFalse: [ self errorIncorrectNumberOfPoints: aCollectionOfPoints size] ] -{ #category : #accessing } +{ #category : 'accessing' } OGCLine >> length [ ^ spatialReferenceSystem length: self ] diff --git a/OGC-Core/OGCLineString.class.st b/OGC-Core/OGCLineString.class.st index 637a199..196cfe4 100644 --- a/OGC-Core/OGCLineString.class.st +++ b/OGC-Core/OGCLineString.class.st @@ -7,20 +7,21 @@ A LineString is a Curve with linear interpolation between Points. Each consecutive pair of Points defines a Line segment. " Class { - #name : #OGCLineString, - #superclass : #OGCCurve, + #name : 'OGCLineString', + #superclass : 'OGCCurve', #instVars : [ 'lines' ], - #category : #'OGC-Core' + #category : 'OGC-Core', + #package : 'OGC-Core' } -{ #category : #accessing } +{ #category : 'accessing' } OGCLineString class >> geometryType [ ^ 'LineString' ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } OGCLineString >> getLines [ | resultLines | resultLines := OrderedCollection new. @@ -28,25 +29,25 @@ OGCLineString >> getLines [ ^ resultLines ] -{ #category : #accessing } +{ #category : 'accessing' } OGCLineString >> length [ | lengthLines | lengthLines := (self lines collect: [ :aLine | aLine length ]). ^ lengthLines ifNotEmpty: [ lengthLines sum ] ifEmpty: [ 0 ] ] -{ #category : #accessing } +{ #category : 'accessing' } OGCLineString >> lines [ ^ lines ifNil: [ lines := self getLines ] ] -{ #category : #access } +{ #category : 'access' } OGCLineString >> numPoints [ "The number of Points in this LineString" ^ points size ] -{ #category : #access } +{ #category : 'access' } OGCLineString >> pointN: anInteger [ "Returns the specified Point N in this LineString" ^ points at: anInteger diff --git a/OGC-Core/OGCLinearRing.class.st b/OGC-Core/OGCLinearRing.class.st index 8fbdab0..55bc443 100644 --- a/OGC-Core/OGCLinearRing.class.st +++ b/OGC-Core/OGCLinearRing.class.st @@ -8,22 +8,23 @@ A LinearRing is **a LineString** that is: - **simple**: no intersection " Class { - #name : #OGCLinearRing, - #superclass : #OGCLineString, - #category : #'OGC-Core' + #name : 'OGCLinearRing', + #superclass : 'OGCLineString', + #category : 'OGC-Core', + #package : 'OGC-Core' } -{ #category : #accessing } +{ #category : 'accessing' } OGCLinearRing class >> geometryType [ ^ 'LinearRing' ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } OGCLinearRing class >> notALinearRing: isClosed and: isSimple [ OGCNotALinearRingError signal: isClosed and: isSimple ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } OGCLinearRing class >> withPoints: aCollectionOfPoints [ | lineString | lineString := self superclass withPoints: aCollectionOfPoints. diff --git a/OGC-Core/OGCMeasureReferenceSystem.class.st b/OGC-Core/OGCMeasureReferenceSystem.class.st index 09af23c..74ab827 100644 --- a/OGC-Core/OGCMeasureReferenceSystem.class.st +++ b/OGC-Core/OGCMeasureReferenceSystem.class.st @@ -3,7 +3,8 @@ The m coordinate value allows the application environment to associate some measure with the point values " Class { - #name : #OGCMeasureReferenceSystem, - #superclass : #OGCReferenceSystem, - #category : #'OGC-Core' + #name : 'OGCMeasureReferenceSystem', + #superclass : 'OGCReferenceSystem', + #category : 'OGC-Core', + #package : 'OGC-Core' } diff --git a/OGC-Core/OGCMultiCurve.class.st b/OGC-Core/OGCMultiCurve.class.st index 613f7e1..38e2d3b 100644 --- a/OGC-Core/OGCMultiCurve.class.st +++ b/OGC-Core/OGCMultiCurve.class.st @@ -15,33 +15,34 @@ A MultiCurve is closed if all of its elements are closed. The boundary of a clos A MultiCurve is defined as topologically closed. " Class { - #name : #OGCMultiCurve, - #superclass : #OGCGeometryCollection, - #category : #'OGC-Core' + #name : 'OGCMultiCurve', + #superclass : 'OGCGeometryCollection', + #category : 'OGC-Core', + #package : 'OGC-Core' } -{ #category : #accessing } +{ #category : 'accessing' } OGCMultiCurve class >> geometryType [ ^ 'MultiCurve' ] -{ #category : #testing } +{ #category : 'testing' } OGCMultiCurve class >> isAbstract [ ^ self == OGCMultiCurve ] -{ #category : #basic } +{ #category : 'basic' } OGCMultiCurve >> dimension [ ^ 1 ] -{ #category : #testing } +{ #category : 'testing' } OGCMultiCurve >> isClosed [ "A MultiCurve is closed if all of its elements are closed." ^ self geometries allSatisfy: [ :each | each isClosed ] ] -{ #category : #accessing } +{ #category : 'accessing' } OGCMultiCurve >> length [ ^ self geometries sum: [ :each | each length ] ] diff --git a/OGC-Core/OGCMultiLineString.class.st b/OGC-Core/OGCMultiLineString.class.st index 2615bd1..80c93f0 100644 --- a/OGC-Core/OGCMultiLineString.class.st +++ b/OGC-Core/OGCMultiLineString.class.st @@ -4,17 +4,18 @@ A MultiLineString is a MultiCurve whose elements are LineStrings. " Class { - #name : #OGCMultiLineString, - #superclass : #OGCMultiCurve, - #category : #'OGC-Core' + #name : 'OGCMultiLineString', + #superclass : 'OGCMultiCurve', + #category : 'OGC-Core', + #package : 'OGC-Core' } -{ #category : #accessing } +{ #category : 'accessing' } OGCMultiLineString class >> geometryType [ ^ 'MultiLineString' ] -{ #category : #accessing } +{ #category : 'accessing' } OGCMultiLineString >> coordinates: aCollection [ geometries := aCollection collect: [ :each | OGCLineString new coordinates: each ] diff --git a/OGC-Core/OGCMultiPoint.class.st b/OGC-Core/OGCMultiPoint.class.st index cdfd232..85a912e 100644 --- a/OGC-Core/OGCMultiPoint.class.st +++ b/OGC-Core/OGCMultiPoint.class.st @@ -10,46 +10,47 @@ Every MultiPoint is spatially equal under the definition in Clause 6.1.15.3 to a The boundary of a MultiPoint is the empty set. " Class { - #name : #OGCMultiPoint, - #superclass : #OGCGeometryCollection, - #category : #'OGC-Core' + #name : 'OGCMultiPoint', + #superclass : 'OGCGeometryCollection', + #category : 'OGC-Core', + #package : 'OGC-Core' } -{ #category : #accessing } +{ #category : 'accessing' } OGCMultiPoint class >> geometryType [ ^ 'MultiPoint' ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } OGCMultiPoint class >> withPoints: aBagOfPoints [ ^ self new geometries: aBagOfPoints ] -{ #category : #basic } +{ #category : 'basic' } OGCMultiPoint >> boundary [ ^ OGCEmptySet new ] -{ #category : #accessing } +{ #category : 'accessing' } OGCMultiPoint >> dimension [ "The inherent dimension of this geometric object, which must be less than or equal to the coordinate dimension." ^ 0 ] -{ #category : #basic } +{ #category : 'basic' } OGCMultiPoint >> isSimple [ "A MultiPoint is simple if no two Points in the MultiPoint are equal" ^ (self geometries size == self geometries asSet size) ] -{ #category : #testing } +{ #category : 'testing' } OGCMultiPoint >> locateAlong: mValue [ "Returns a derived geometry collection value that matches the specified m coordinate value. See Subclause 6.1.2.6 “Measures on Geometry” for more details" ^ self locateBetween: mValue and: mValue ] -{ #category : #testing } +{ #category : 'testing' } OGCMultiPoint >> locateBetween: mStart and: mEnd [ | resultPoints | resultPoints := self geometries select: [ :each | each m >= mStart and: each m<= mEnd ]. diff --git a/OGC-Core/OGCMultiPolygon.class.st b/OGC-Core/OGCMultiPolygon.class.st index 43f8176..6cec84f 100644 --- a/OGC-Core/OGCMultiPolygon.class.st +++ b/OGC-Core/OGCMultiPolygon.class.st @@ -18,17 +18,18 @@ The reader is referred to works by Worboys et al.([13], [14]) and Clementini et specification of MultiPolygons. " Class { - #name : #OGCMultiPolygon, - #superclass : #OGCMultiSurface, - #category : #'OGC-Core' + #name : 'OGCMultiPolygon', + #superclass : 'OGCMultiSurface', + #category : 'OGC-Core', + #package : 'OGC-Core' } -{ #category : #accessing } +{ #category : 'accessing' } OGCMultiPolygon class >> geometryType [ ^ 'MultiPolygon' ] -{ #category : #accessing } +{ #category : 'accessing' } OGCMultiPolygon >> coordinates: aCollection [ self geometries: (aCollection collect: [ :each | OGCPolygon new coordinates: each ]) diff --git a/OGC-Core/OGCMultiSurface.class.st b/OGC-Core/OGCMultiSurface.class.st index 0eabb92..269e4dd 100644 --- a/OGC-Core/OGCMultiSurface.class.st +++ b/OGC-Core/OGCMultiSurface.class.st @@ -14,12 +14,13 @@ MultiSurface is MultiPolygon corresponding to a collection of Polygons only. Oth MultiSurface. " Class { - #name : #OGCMultiSurface, - #superclass : #OGCGeometryCollection, - #category : #'OGC-Core' + #name : 'OGCMultiSurface', + #superclass : 'OGCGeometryCollection', + #category : 'OGC-Core', + #package : 'OGC-Core' } -{ #category : #testing } +{ #category : 'testing' } OGCMultiSurface class >> isAbstract [ ^ self = OGCMultiSurface ] diff --git a/OGC-Core/OGCNotALinearRingError.class.st b/OGC-Core/OGCNotALinearRingError.class.st index 6422963..21c6ff5 100644 --- a/OGC-Core/OGCNotALinearRingError.class.st +++ b/OGC-Core/OGCNotALinearRingError.class.st @@ -2,16 +2,18 @@ When a linear ring wants to be instantiate but is not simple or is not closed " Class { - #name : #OGCNotALinearRingError, - #superclass : #Error, + #name : 'OGCNotALinearRingError', + #superclass : 'Error', #instVars : [ 'isSimple', 'isClosed' ], - #category : #'OGC-Core-Errors' + #category : 'OGC-Core-Errors', + #package : 'OGC-Core', + #tag : 'Errors' } -{ #category : #signalling } +{ #category : 'signalling' } OGCNotALinearRingError class >> signal: answerIsClosed and: answerIsSimple [ ^ self new isSimple: answerIsClosed; @@ -19,24 +21,24 @@ OGCNotALinearRingError class >> signal: answerIsClosed and: answerIsSimple [ signal ] -{ #category : #accessing } +{ #category : 'accessing' } OGCNotALinearRingError >> isClosed: aBoolean [ isClosed := aBoolean ] -{ #category : #accessing } +{ #category : 'accessing' } OGCNotALinearRingError >> isSimple: aBoolean [ isSimple := aBoolean ] -{ #category : #accessing } +{ #category : 'accessing' } OGCNotALinearRingError >> messageText [ "Overwritten to initialiaze the message text to a standard text if it has not yet been set" ^ messageText ifNil: [ messageText := self standardMessageText ] ] -{ #category : #printing } +{ #category : 'printing' } OGCNotALinearRingError >> standardMessageText [ "Generate a standard textual description" | isClosedMessage isSimpleMessage | diff --git a/OGC-Core/OGCObject.class.st b/OGC-Core/OGCObject.class.st index 9600e9f..1c63cd9 100644 --- a/OGC-Core/OGCObject.class.st +++ b/OGC-Core/OGCObject.class.st @@ -1,10 +1,11 @@ Class { - #name : #OGCObject, - #superclass : #Object, - #category : #'OGC-Core' + #name : 'OGCObject', + #superclass : 'Object', + #category : 'OGC-Core', + #package : 'OGC-Core' } -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } OGCObject class >> createStyleDictionary: anArray [ " return a dictionary which can be used as a style dictionary for a OGCGeometry, based on data given as the following array of strings : [ ] " | styleDictionary keys | @@ -14,34 +15,34 @@ OGCObject class >> createStyleDictionary: anArray [ ^ styleDictionary ] -{ #category : #testing } +{ #category : 'testing' } OGCObject class >> isAbstract [ ^ self = OGCObject ] -{ #category : #style } +{ #category : 'style' } OGCObject >> applyContinuousColorationOn: aDataKey withFeatureData: aCSVArray withAssociateKey: aDataAssociateKey withColor: aColorName [ self subclassResponsibility ] -{ #category : #style } +{ #category : 'style' } OGCObject >> applyStyle: aStyleDictionary [ " apply the given style (as a dictionary) to every elements" self subclassResponsibility ] -{ #category : #style } +{ #category : 'style' } OGCObject >> applyStyle: aStyleDictionary ifFeature: aBlock [ " apply the given style to features which respect given block closure" self subclassResponsibility ] -{ #category : #converting } +{ #category : 'converting' } OGCObject >> asFeaturesCollection [ self subclassResponsibility ] -{ #category : #basic } +{ #category : 'basic' } OGCObject >> rectangularEnvelope [ " return a rectangle which can contain all geometries" self subclassResponsibility diff --git a/OGC-Core/OGCPoint.class.st b/OGC-Core/OGCPoint.class.st index 8b103cf..dc981aa 100644 --- a/OGC-Core/OGCPoint.class.st +++ b/OGC-Core/OGCPoint.class.st @@ -9,8 +9,8 @@ have coordinate values for z and m. The boundary of a Point is the empty set. " Class { - #name : #OGCPoint, - #superclass : #OGCGeometry, + #name : 'OGCPoint', + #superclass : 'OGCGeometry', #instVars : [ 'x', 'y', @@ -18,29 +18,30 @@ Class { 'm', 'icon' ], - #category : #'OGC-Core' + #category : 'OGC-Core', + #package : 'OGC-Core' } -{ #category : #accessing } +{ #category : 'accessing' } OGCPoint class >> geometryType [ ^ 'Point' ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } OGCPoint class >> latitude: latitude longitude: longitude [ ^ self new x: longitude; y: latitude ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } OGCPoint class >> x: xNumber y: yNumber [ ^ self new x: xNumber; y: yNumber ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } OGCPoint class >> x: xNumber y: yNumber m:mNumber [ ^ self new x: xNumber; @@ -48,28 +49,28 @@ OGCPoint class >> x: xNumber y: yNumber m:mNumber [ m: mNumber ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } OGCPoint class >> xy: anArray [ ^ self x: anArray first y: anArray second ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } OGCPoint class >> xym: anArray [ ^ self x: anArray first y: anArray second m: anArray last ] -{ #category : #comparing } +{ #category : 'comparing' } OGCPoint >> = anOGCPoint [ (self species == anOGCPoint species) ifFalse: [ ^ false ]. ^ (x = anOGCPoint x) & (y = anOGCPoint y) & (z = anOGCPoint z) ] -{ #category : #conversion } +{ #category : 'conversion' } OGCPoint >> asPoint [ ^ x @ y ] -{ #category : #basic } +{ #category : 'basic' } OGCPoint >> boundary [ "Geometry — Returns the closure of the combinatorial boundary of this geometric object (Reference [1], section 3.12.2). Because the result of this function is a closure, and hence topologically @@ -78,12 +79,12 @@ section 3.12.2). The return type is integer, but is interpreted as Boolean, TRUE ^ OGCEmptySet new ] -{ #category : #accessing } +{ #category : 'accessing' } OGCPoint >> coordinates [ - ^ Array braceWith: self x with: self y + ^ { self x . self y } ] -{ #category : #accessing } +{ #category : 'accessing' } OGCPoint >> coordinates: aCollection [ "a point should only have two coordinates being numbers" | coordinates | @@ -92,47 +93,47 @@ OGCPoint >> coordinates: aCollection [ self y: coordinates second. ] -{ #category : #accessing } +{ #category : 'accessing' } OGCPoint >> dimension [ ^ 0 ] -{ #category : #'methods analysis' } +{ #category : 'methods analysis' } OGCPoint >> distance: anotherGeometry [ ^ spatialReferenceSystem distance: self toPoint: anotherGeometry ] -{ #category : #comparing } +{ #category : 'comparing' } OGCPoint >> hash [ ^ (x hash bitXor: y hash) bitXor: z hash ] -{ #category : #testing } +{ #category : 'testing' } OGCPoint >> is3D [ ^ z notNil ] -{ #category : #testing } +{ #category : 'testing' } OGCPoint >> isEmpty [ ^ (x isNil) & (y isNil) & (z isNil) & (m isNil) ] -{ #category : #basic } +{ #category : 'basic' } OGCPoint >> isMeasured [ ^ m isNotNil ] -{ #category : #accessing } +{ #category : 'accessing' } OGCPoint >> latitude [ ^ self y ] -{ #category : #accessing } +{ #category : 'accessing' } OGCPoint >> latitude: aNumberOrString [ self y: aNumberOrString asNumber ] -{ #category : #testing } +{ #category : 'testing' } OGCPoint >> locateBetween: mStart and: mEnd [ "Returns a derived geometry collection value that matches the specified range of m coordinate values inclusively. See Subclause 6.1.2.6 “Measures on @@ -142,27 +143,27 @@ Geometry” for more details." ifFalse: [ OGCEmptySet new ] ] -{ #category : #accessing } +{ #category : 'accessing' } OGCPoint >> longitude [ ^ self x ] -{ #category : #accessing } +{ #category : 'accessing' } OGCPoint >> longitude: aNumberOrString [ self x: aNumberOrString asNumber ] -{ #category : #accessing } +{ #category : 'accessing' } OGCPoint >> m [ ^ m ] -{ #category : #accessing } +{ #category : 'accessing' } OGCPoint >> m: aFloat [ m := aFloat ] -{ #category : #accessing } +{ #category : 'accessing' } OGCPoint >> max: anOGCPoint [ ^ OGCPoint @@ -170,7 +171,7 @@ OGCPoint >> max: anOGCPoint [ y: (y max: anOGCPoint y) ] -{ #category : #accessing } +{ #category : 'accessing' } OGCPoint >> min: anOGCPoint [ ^ OGCPoint @@ -178,19 +179,19 @@ OGCPoint >> min: anOGCPoint [ y: (y min: anOGCPoint y) ] -{ #category : #printing } +{ #category : 'printing' } OGCPoint >> printOn: aStream [ aStream << x asString << ',' << y asString. z ifNotNil: [ aStream << ',' << z asString ] ] -{ #category : #geometry } +{ #category : 'geometry' } OGCPoint >> rectangularEnvelope [ ^ x@y corner: x@y ] -{ #category : #'truncation and round off' } +{ #category : 'truncation and round off' } OGCPoint >> roundTo: grid [ | gridPoint | @@ -200,37 +201,37 @@ OGCPoint >> roundTo: grid [ y: (y roundTo: gridPoint y) ] -{ #category : #geometry } +{ #category : 'geometry' } OGCPoint >> to: end1 intersects: start2 to: end2 [ ^ self asPoint to: end1 intersects: start2 to: end2 ] -{ #category : #accessing } +{ #category : 'accessing' } OGCPoint >> x [ ^ x ] -{ #category : #accessing } +{ #category : 'accessing' } OGCPoint >> x: aFloat [ x:= aFloat ] -{ #category : #accessing } +{ #category : 'accessing' } OGCPoint >> y [ ^ y ] -{ #category : #accessing } +{ #category : 'accessing' } OGCPoint >> y: aFloat [ y:= aFloat ] -{ #category : #accessing } +{ #category : 'accessing' } OGCPoint >> z [ ^ z ] -{ #category : #accessing } +{ #category : 'accessing' } OGCPoint >> z: aFloat [ z := aFloat ] diff --git a/OGC-Core/OGCPolygon.class.st b/OGC-Core/OGCPolygon.class.st index 5130121..07ef764 100644 --- a/OGC-Core/OGCPolygon.class.st +++ b/OGC-Core/OGCPolygon.class.st @@ -16,20 +16,21 @@ c) No two Rings in the boundary cross and the Rings in the boundary of a Polygon only as a tangent, e.g. " Class { - #name : #OGCPolygon, - #superclass : #OGCSurface, + #name : 'OGCPolygon', + #superclass : 'OGCSurface', #instVars : [ 'interiorRings' ], - #category : #'OGC-Core' + #category : 'OGC-Core', + #package : 'OGC-Core' } -{ #category : #accessing } +{ #category : 'accessing' } OGCPolygon class >> geometryType [ ^ 'Polygon' ] -{ #category : #testing } +{ #category : 'testing' } OGCPolygon >> = anotherPolygon [ ^ self class = anotherPolygon class and: [ self interiorRings = anotherPolygon interiorRings @@ -38,19 +39,19 @@ OGCPolygon >> = anotherPolygon [ ] ] -{ #category : #accessing } +{ #category : 'accessing' } OGCPolygon >> addInteriorRing: anOGCLinearRing [ anOGCLinearRing isClosed ifFalse: [ Error signal: 'linear ring is not closed' ]. self interiorRings add: anOGCLinearRing ] -{ #category : #accessing } +{ #category : 'accessing' } OGCPolygon >> coordinates [ ^ exteriorRing points collect: #coordinates ] -{ #category : #accessing } +{ #category : 'accessing' } OGCPolygon >> coordinates: aCollection [ (aCollection anySatisfy: [ :each | each class = Array ]) ifTrue: [ @@ -66,39 +67,39 @@ OGCPolygon >> coordinates: aCollection [ ] ] -{ #category : #style } +{ #category : 'style' } OGCPolygon >> defaultFillColor [ ^ 'white' ] -{ #category : #style } +{ #category : 'style' } OGCPolygon >> defaultFillOpacity [ ^ '0.5' ] -{ #category : #comparing } +{ #category : 'comparing' } OGCPolygon >> hash [ ^ self interiorRings hash bitXor: self exteriorRing hash ] -{ #category : #accessing } +{ #category : 'accessing' } OGCPolygon >> interiorRingN: anInteger [ "Returns the Nth interior ring for this Polygon as a LineString." ^ interiorRings at: anInteger ] -{ #category : #accessing } +{ #category : 'accessing' } OGCPolygon >> interiorRings [ ^ interiorRings ifNil: [ interiorRings := OrderedCollection new ] ] -{ #category : #accessing } +{ #category : 'accessing' } OGCPolygon >> interiorRings: anObject [ interiorRings := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } OGCPolygon >> numInteriorRing [ "Returns the number of interior rings in this Polygon" ^ interiorRings size diff --git a/OGC-Core/OGCPolyhedralSurface.class.st b/OGC-Core/OGCPolyhedralSurface.class.st index f37344c..c529fe5 100644 --- a/OGC-Core/OGCPolyhedralSurface.class.st +++ b/OGC-Core/OGCPolyhedralSurface.class.st @@ -3,37 +3,38 @@ A PolyhedralSurface is a contiguous collection of polygons, which share common b pair of polygons that “touch”, the common boundary shall be expressible as a finite collection of LineStrings. " Class { - #name : #OGCPolyhedralSurface, - #superclass : #OGCSurface, - #category : #'OGC-Core' + #name : 'OGCPolyhedralSurface', + #superclass : 'OGCSurface', + #category : 'OGC-Core', + #package : 'OGC-Core' } -{ #category : #accessing } +{ #category : 'accessing' } OGCPolyhedralSurface class >> geometryType [ ^ 'PolyhedralSurface' ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } OGCPolyhedralSurface >> boundingPolygon: aPolygon [ "Returns the collection of polygons MultiPolygon, in this surface that bounds the given polygon for any polygon in the surface" ] -{ #category : #accessing } +{ #category : 'accessing' } OGCPolyhedralSurface >> coordinates [ ^ exteriorRing collect: #coordinates ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } OGCPolyhedralSurface >> isClosed [ " Returns 1 (True) if the polygon closes on itself, and thus has no boundary and encloses a solid" ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } OGCPolyhedralSurface >> numPatches [ "Returns the number of including polygons" ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } OGCPolyhedralSurface >> patchesN: anInteger [ "Returns a polygon in this surface, the order is arbitrary" ] diff --git a/OGC-Core/OGCReferenceSystem.class.st b/OGC-Core/OGCReferenceSystem.class.st index a33e80c..ef4446b 100644 --- a/OGC-Core/OGCReferenceSystem.class.st +++ b/OGC-Core/OGCReferenceSystem.class.st @@ -4,22 +4,23 @@ A reference system contains: - one measure reference system if needed " Class { - #name : #OGCReferenceSystem, - #superclass : #Object, - #category : #'OGC-Core' + #name : 'OGCReferenceSystem', + #superclass : 'Object', + #category : 'OGC-Core', + #package : 'OGC-Core' } -{ #category : #accessing } +{ #category : 'accessing' } OGCReferenceSystem class >> axisName [ self subclassResponsibility ] -{ #category : #accessing } +{ #category : 'accessing' } OGCReferenceSystem class >> dimension [ self subclassResponsibility ] -{ #category : #testing } +{ #category : 'testing' } OGCReferenceSystem class >> isAbstract [ ^ true ] diff --git a/OGC-Core/OGCSpatialReferenceSystem.class.st b/OGC-Core/OGCSpatialReferenceSystem.class.st index 45fd96c..579b05e 100644 --- a/OGC-Core/OGCSpatialReferenceSystem.class.st +++ b/OGC-Core/OGCSpatialReferenceSystem.class.st @@ -4,7 +4,8 @@ A spatial reference system (SRS) or coordinate reference system (CRS) is a coord A SRS commonly defines a specific map projection, as well as transformations between different SRS. " Class { - #name : #OGCSpatialReferenceSystem, - #superclass : #OGCReferenceSystem, - #category : #'OGC-Core' + #name : 'OGCSpatialReferenceSystem', + #superclass : 'OGCReferenceSystem', + #category : 'OGC-Core', + #package : 'OGC-Core' } diff --git a/OGC-Core/OGCSurface.class.st b/OGC-Core/OGCSurface.class.st index 2556ef3..c683b3e 100644 --- a/OGC-Core/OGCSurface.class.st +++ b/OGC-Core/OGCSurface.class.st @@ -10,60 +10,61 @@ simple affine rotation matrix that rotates the patch onto the plane z = 0. If th onto the same plane is an isomorphism, and can be represented as a linear transformation, i.e. an affine. " Class { - #name : #OGCSurface, - #superclass : #OGCGeometry, + #name : 'OGCSurface', + #superclass : 'OGCGeometry', #instVars : [ 'exteriorRing' ], - #category : #'OGC-Core' + #category : 'OGC-Core', + #package : 'OGC-Core' } -{ #category : #testing } +{ #category : 'testing' } OGCSurface class >> isAbstract [ ^ self == OGCSurface ] -{ #category : #basic } +{ #category : 'basic' } OGCSurface >> area [ "The area of this Surface, as measured in the spatial reference system of this Surface." self subclassResponsibility ] -{ #category : #basic } +{ #category : 'basic' } OGCSurface >> boundary [ self subclassResponsibility ] -{ #category : #basic } +{ #category : 'basic' } OGCSurface >> centroid [ "The mathematical centroid for this Surface as a Point. The result is not guaranteed to be on this Surface." self subclassResponsibility ] -{ #category : #basic } +{ #category : 'basic' } OGCSurface >> dimension [ "The inherent dimension of this geometric object, which must be less than or equal to the coordinate dimension." ^ 2 ] -{ #category : #accessing } +{ #category : 'accessing' } OGCSurface >> exteriorRing [ ^ exteriorRing ] -{ #category : #accessing } +{ #category : 'accessing' } OGCSurface >> exteriorRing: anObject [ exteriorRing := anObject ] -{ #category : #basic } +{ #category : 'basic' } OGCSurface >> pointOnSurface [ "A Point guaranteed to be on this Surface" self subclassResponsibility ] -{ #category : #basic } +{ #category : 'basic' } OGCSurface >> rectangularEnvelope [ " Returns [ minX, maxX, minY, maxY ] to define minimal rectangle which contains all features " ^ exteriorRing rectangularEnvelope diff --git a/OGC-Core/OGCTIN.class.st b/OGC-Core/OGCTIN.class.st index 5214de6..dae5812 100644 --- a/OGC-Core/OGCTIN.class.st +++ b/OGC-Core/OGCTIN.class.st @@ -2,7 +2,8 @@ A TIN (triangulated irregular network) is a PolyhedralSurface consisting only of Triangle patches " Class { - #name : #OGCTIN, - #superclass : #OGCPolyhedralSurface, - #category : #'OGC-Core' + #name : 'OGCTIN', + #superclass : 'OGCPolyhedralSurface', + #category : 'OGC-Core', + #package : 'OGC-Core' } diff --git a/OGC-Core/OGCTriangle.class.st b/OGC-Core/OGCTriangle.class.st index 75ceb23..14c06ca 100644 --- a/OGC-Core/OGCTriangle.class.st +++ b/OGC-Core/OGCTriangle.class.st @@ -3,27 +3,28 @@ A Triangle is a polygon with 3 distinct, non-collinear vertices and no interior boundary " Class { - #name : #OGCTriangle, - #superclass : #OGCPolygon, - #category : #'OGC-Core' + #name : 'OGCTriangle', + #superclass : 'OGCPolygon', + #category : 'OGC-Core', + #package : 'OGC-Core' } -{ #category : #accessing } +{ #category : 'accessing' } OGCTriangle class >> geometryType [ ^ 'Triangle' ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } OGCTriangle class >> withExteriorRing: aLineString [ ^ self new exteriorRing: aLineString ] -{ #category : #basic } +{ #category : 'basic' } OGCTriangle >> area [ ^ spatialReferenceSystem area: self ] -{ #category : #basic } +{ #category : 'basic' } OGCTriangle >> boundary [ ^ exteriorRing ] diff --git a/OGC-Core/package.st b/OGC-Core/package.st index 25b707b..bf14b44 100644 --- a/OGC-Core/package.st +++ b/OGC-Core/package.st @@ -1 +1 @@ -Package { #name : #'OGC-Core' } +Package { #name : 'OGC-Core' }