-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
40 changed files
with
2,005 additions
and
1,730 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,45 @@ | ||
Class { | ||
#name : #BaselineOfOGC, | ||
#superclass : #BaselineOf, | ||
#category : #BaselineOfOGC | ||
} | ||
|
||
{ #category : #baselines } | ||
BaselineOfOGC >> baseline: spec [ | ||
<baseline> | ||
|
||
spec for: #'common' do: [ | ||
self geometry: spec. | ||
spec | ||
package: #'OGC-Core'; | ||
package: #'OGC-Core-Tests' with: [ | ||
spec requires: #('OGC-Core' ) ]; | ||
package: #'OGC-Viewer'; | ||
package: #'OGC-Viewer-Tests'; | ||
package: #'OGC-Geometry' with: [ | ||
spec requires: #('OGC-Core' 'Geometry') ]; | ||
package: #'OGC-Geometry-Tests' with: [ | ||
spec requires: #('OGC-Core-Tests' 'OGC-Geometry') ]; | ||
package: #'OGC-Spheric' with: [ | ||
spec requires: #('OGC-Core' ) ]; | ||
package: #'OGC-Spheric-Tests' with: [ | ||
spec requires: #('OGC-Core-Tests' 'OGC-Spheric') ]. | ||
spec | ||
group: 'Core' with: #('OGC-Core' ); | ||
group: 'Tests' with: #('OGC-Core-Tests'); | ||
group: 'Geometric' with: #('OGC-Geometry' 'OGC-Geometry-Tests'); | ||
group: 'Spheric' with: #('OGC-Spheric' 'OGC-Spheric-Tests'); | ||
group: 'Visualisation' with: #('OGC-Viewer' 'OGC-Viewer-Tests'); | ||
group: 'default' with: #('Core' 'Tests' 'Spheric' 'Visualisation'). | ||
] | ||
|
||
] | ||
|
||
{ #category : #accessing } | ||
BaselineOfOGC >> geometry: spec [ | ||
"For Geometric projection computation" | ||
spec | ||
baseline: 'Geometry' | ||
with: [ | ||
spec repository: 'github://pharo-contributions/Geometry:master/src' ] | ||
] | ||
Class { | ||
#name : #BaselineOfOGC, | ||
#superclass : #BaselineOf, | ||
#category : #BaselineOfOGC | ||
} | ||
|
||
{ #category : #baselines } | ||
BaselineOfOGC >> baseline: spec [ | ||
<baseline> | ||
|
||
spec for: #'common' do: [ | ||
self geometry: spec. | ||
spec | ||
package: #'OGC-Core'; | ||
package: #'OGC-Core-Tests' with: [ | ||
spec requires: #('OGC-Core' ) ]; | ||
package: #'OGC-Viewer'; | ||
package: #'OGC-Viewer-Tests'; | ||
package: #'OGC-Geometry' with: [ | ||
spec requires: #('OGC-Core' 'Geometry') ]; | ||
package: #'OGC-Geometry-Tests' with: [ | ||
spec requires: #('OGC-Core-Tests' 'OGC-Geometry') ]; | ||
package: #'OGC-Spheric' with: [ | ||
spec requires: #('OGC-Core' ) ]; | ||
package: #'OGC-Spheric-Tests' with: [ | ||
spec requires: #('OGC-Core-Tests' 'OGC-Spheric') ]. | ||
spec | ||
group: 'Core' with: #('OGC-Core' ); | ||
group: 'Tests' with: #('OGC-Core-Tests'); | ||
group: 'Geometric' with: #('OGC-Geometry' 'OGC-Geometry-Tests'); | ||
group: 'Spheric' with: #('OGC-Spheric' 'OGC-Spheric-Tests'); | ||
group: 'Visualisation' with: #('OGC-Viewer' 'OGC-Viewer-Tests'); | ||
group: 'default' with: #('Core' 'Tests' 'Geometric' 'Visualisation'). | ||
] | ||
|
||
] | ||
|
||
{ #category : #accessing } | ||
BaselineOfOGC >> geometry: spec [ | ||
"For Geometric projection computation" | ||
spec | ||
baseline: 'Geometry' | ||
with: [ | ||
spec repository: 'github://pharo-contributions/Geometry:master/src' ] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
Package { #name : #BaselineOfOGC } | ||
Package { #name : #BaselineOfOGC } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
" | ||
Implementation of Simple Feature Access Standard from OGC: https://www.ogc.org/standards/sfa | ||
" | ||
Class { | ||
#name : #ManifestOGCCore, | ||
#superclass : #PackageManifest, | ||
#category : #'OGC-Core-Manifest' | ||
} | ||
" | ||
Implementation of Simple Feature Access Standard from OGC: https://www.ogc.org/standards/sfa | ||
" | ||
Class { | ||
#name : #ManifestOGCCore, | ||
#superclass : #PackageManifest, | ||
#category : #'OGC-Core-Manifest' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,118 +1,123 @@ | ||
" | ||
6.1.6 Curve | ||
6.1.6.1 Description | ||
A Curve is a 1-dimensional geometric object usually stored as a sequence of Points, with the subtype of Curve | ||
specifying the form of the interpolation between Points. This standard defines only one subclass of Curve, | ||
LineString, which uses linear interpolation between Points. | ||
" | ||
Class { | ||
#name : #OGCCurve, | ||
#superclass : #OGCGeometry, | ||
#instVars : [ | ||
'points' | ||
], | ||
#category : #'OGC-Core' | ||
} | ||
|
||
{ #category : #accessing } | ||
OGCCurve class >> geometryType [ | ||
^ 'Curve' | ||
] | ||
|
||
{ #category : #'as yet unclassified' } | ||
OGCCurve class >> withPoints: aCollectionOfPoints [ | ||
^ self new points: aCollectionOfPoints | ||
|
||
] | ||
|
||
{ #category : #testing } | ||
OGCCurve >> = anotherCurve [ | ||
^ (self points) = (anotherCurve points) | ||
] | ||
|
||
{ #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 } | ||
OGCCurve >> coordinates [ | ||
^ self points | ||
] | ||
|
||
{ #category : #accessing } | ||
OGCCurve >> coordinates: aCollection [ | ||
self points: (aCollection collect: [ :each | OGCPoint xy: each ]) | ||
] | ||
|
||
{ #category : #style } | ||
OGCCurve >> defaultFillColor [ | ||
^ 'transparent' | ||
] | ||
|
||
{ #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 } | ||
OGCCurve >> endPoint [ | ||
^ points last | ||
] | ||
|
||
{ #category : #accessing } | ||
OGCCurve >> isClosed [ | ||
^ self startPoint = self endPoint | ||
] | ||
|
||
{ #category : #testing } | ||
OGCCurve >> isLine [ | ||
^ points size = 2 | ||
] | ||
|
||
{ #category : #testing } | ||
OGCCurve >> isRing [ | ||
^ self isClosed & self isSimple | ||
] | ||
|
||
{ #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" | ||
| setSize | | ||
setSize := points asSet size. | ||
^ (points size == setSize) ifFalse: [ (setSize == (points size - 1)) and: (self isClosed) ] | ||
] | ||
|
||
{ #category : #accessing } | ||
OGCCurve >> length [ | ||
"The length of this Curve in its associated spatial reference" | ||
self subclassResponsibility | ||
] | ||
|
||
{ #category : #accessing } | ||
OGCCurve >> points [ | ||
^ points | ||
] | ||
|
||
{ #category : #accessing } | ||
OGCCurve >> points: anObject [ | ||
points := anObject | ||
] | ||
|
||
{ #category : #basic } | ||
OGCCurve >> rectangularEnvelope [ | ||
" Returns the minimal rectangle which contains all features " | ||
| allRectangularEnvelopes | | ||
allRectangularEnvelopes := points collect: [ :aPoint | aPoint rectangularEnvelope ]. | ||
^ allRectangularEnvelopes reduce: [ :rect1 :rect2 | rect1 merge: rect2 ] | ||
] | ||
|
||
{ #category : #accessing } | ||
OGCCurve >> startPoint [ | ||
^ points first | ||
] | ||
" | ||
###6.1.6 Curve | ||
###6.1.6.1 Description | ||
A Curve is a 1-dimensional geometric object usually stored as a sequence of Points, with the subtype of Curve specifying the form of the interpolation between Points. | ||
This standard defines only one subclass of Curve, LineString, which uses linear interpolation between Points. | ||
Points are stored in `points` instance variable as a sequence of `OGCPoint` | ||
I am an **abstract** class. | ||
Instanciation: | ||
`OGCCurve class>>#withPoints:` | ||
" | ||
Class { | ||
#name : #OGCCurve, | ||
#superclass : #OGCGeometry, | ||
#instVars : [ | ||
'points' | ||
], | ||
#category : #'OGC-Core' | ||
} | ||
|
||
{ #category : #accessing } | ||
OGCCurve class >> geometryType [ | ||
^ 'Curve' | ||
] | ||
|
||
{ #category : #'as yet unclassified' } | ||
OGCCurve class >> withPoints: aCollectionOfPoints [ | ||
^ self new points: aCollectionOfPoints | ||
|
||
] | ||
|
||
{ #category : #testing } | ||
OGCCurve >> = anotherCurve [ | ||
^ (self points) = (anotherCurve points) | ||
] | ||
|
||
{ #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 } | ||
OGCCurve >> coordinates [ | ||
^ self points | ||
] | ||
|
||
{ #category : #accessing } | ||
OGCCurve >> coordinates: aCollection [ | ||
self points: (aCollection collect: [ :each | OGCPoint xy: each ]) | ||
] | ||
|
||
{ #category : #style } | ||
OGCCurve >> defaultFillColor [ | ||
^ 'transparent' | ||
] | ||
|
||
{ #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 } | ||
OGCCurve >> endPoint [ | ||
^ points last | ||
] | ||
|
||
{ #category : #accessing } | ||
OGCCurve >> isClosed [ | ||
^ self startPoint = self endPoint | ||
] | ||
|
||
{ #category : #testing } | ||
OGCCurve >> isLine [ | ||
^ points size = 2 | ||
] | ||
|
||
{ #category : #testing } | ||
OGCCurve >> isRing [ | ||
^ self isClosed & self isSimple | ||
] | ||
|
||
{ #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" | ||
| setSize | | ||
setSize := points asSet size. | ||
^ (points size == setSize) ifFalse: [ (setSize == (points size - 1)) and: (self isClosed) ] | ||
] | ||
|
||
{ #category : #accessing } | ||
OGCCurve >> length [ | ||
"The length of this Curve in its associated spatial reference" | ||
self subclassResponsibility | ||
] | ||
|
||
{ #category : #accessing } | ||
OGCCurve >> points [ | ||
^ points | ||
] | ||
|
||
{ #category : #accessing } | ||
OGCCurve >> points: anObject [ | ||
points := anObject | ||
] | ||
|
||
{ #category : #basic } | ||
OGCCurve >> rectangularEnvelope [ | ||
" Returns the minimal rectangle which contains all features " | ||
| allRectangularEnvelopes | | ||
allRectangularEnvelopes := points collect: [ :aPoint | aPoint rectangularEnvelope ]. | ||
^ allRectangularEnvelopes reduce: [ :rect1 :rect2 | rect1 merge: rect2 ] | ||
] | ||
|
||
{ #category : #accessing } | ||
OGCCurve >> startPoint [ | ||
^ points first | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
" | ||
I am a geometric object with isEmpty = true. | ||
" | ||
Class { | ||
#name : #OGCEmptySet, | ||
#superclass : #OGCGeometry, | ||
#category : #'OGC-Core' | ||
} | ||
|
||
{ #category : #accessing } | ||
OGCEmptySet class >> geometryType [ | ||
^ 'Empty set' | ||
] | ||
|
||
{ #category : #testing } | ||
OGCEmptySet >> = anotherObject [ | ||
^ self isEmpty = anotherObject isEmpty | ||
] | ||
|
||
{ #category : #basic } | ||
OGCEmptySet >> isEmpty [ | ||
^ true | ||
] | ||
" | ||
I am the empty OGCGeometry object, so `isEmpty = true` | ||
" | ||
Class { | ||
#name : #OGCEmptySet, | ||
#superclass : #OGCGeometry, | ||
#category : #'OGC-Core' | ||
} | ||
|
||
{ #category : #accessing } | ||
OGCEmptySet class >> geometryType [ | ||
^ 'Empty set' | ||
] | ||
|
||
{ #category : #testing } | ||
OGCEmptySet >> = anotherObject [ | ||
^ self isEmpty = anotherObject isEmpty | ||
] | ||
|
||
{ #category : #basic } | ||
OGCEmptySet >> isEmpty [ | ||
^ true | ||
] |
Oops, something went wrong.