[2.x] Refactor to remove GeometryType enum #120
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Being in cleanup mood and the open discussion in #118 about the geometry type cast append when building the raw sql, we wanted to remove GeometryType enum completly.
In order to control whether to use Geometry or Geography we added the AsGeometry and AsGeography Expressions, that adds the cast.
Moving the code into those 2 Expressions, we realized, that the
Geometry
andBox
classes could directly implement theExpression
interface.This enabled even more code cleanup.
Before this PR, we casted to geometry all the time, because most of the ST_Functions from PostGIS are defined only on geometry. This PR removes this behavior. The user now needs to decide by himself, which type he wants to use using the cast expressions.
For a better readability we renamed to parameters of postgis functions that can handle geometry and geography to
geometryOrGeography
.