Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alternative logics to resolve axis order #182

Closed
navispatial opened this issue Aug 8, 2023 · 1 comment
Closed

Alternative logics to resolve axis order #182

navispatial opened this issue Aug 8, 2023 · 1 comment
Labels
🌎 geodata Related to the code package "geodata" enhancement New feature or request 🌐 geobase Related to the code package "geobase"

Comments

@navispatial
Copy link
Member

A new enum:

/// An enum for spatial representations that can be used to code logic when
/// need to choose some options based on a representation.
///
/// The original use case for this enum is the problem of choosing the axis
/// order of coordinate values in position and point representations.
enum GeoRepresentation {
  /// The default representation of coordinates and geometries that represents
  /// coordinates in the axis order specified by an authority (like EPSG or
  /// OGC) in cases where order is not explicitely defined elsewhere.
  crsAuthority,

  /// The [GeoJSON](https://geojson.org/) representation of coordinates and
  /// geometries that always represents longitude (or easting) before latitude
  /// (or northing).
  geoJsonStrict,
}

This is used by CoordRefSys (and similarily by CoordRefSysResolver):

  /// Try to resolve the axis order (as a CRS authority has specified it) of
  /// coordinate values in position and point representations for this
  /// coordinate reference system identified by [id].
  ///
  /// The `null` return value is interpreted as "the axis order is not known".
  AxisOrder? get axisOrder;

  /// Whether x and y coordinates read from (or written to) external data
  /// representation should be swapped for the coordinate reference system
  /// identified by [id] before using in internal data structures of this
  /// package.
  ///
  /// Use [logic] to give general guidelines how a result is to be resolved.
  /// When not given `GeoRepresentation.crsAuthority` is used as a default.
  bool swapXY({GeoRepresentation? logic});
@navispatial navispatial added enhancement New feature or request 🌎 geodata Related to the code package "geodata" 🌐 geobase Related to the code package "geobase" labels Aug 8, 2023
This was referenced Aug 11, 2023
@navispatial
Copy link
Member Author

Implemented in geobase 0.5.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌎 geodata Related to the code package "geodata" enhancement New feature or request 🌐 geobase Related to the code package "geobase"
Projects
None yet
Development

No branches or pull requests

1 participant