AshGeo.GeoAny (AshGeo v0.2.0)

Geometry type which attempts to auto-detect and decode from JSON, WKT and WKB

Accepts all options for AshGeo.Geometry, plus prefer_binary_encoding, and may also be narrowed with use in the same way.

Options

  • :prefer_binary_encoding - Which binary encoding format to attempt first: WKT or WKB. Valid values are :wkt, :wkb The default value is :wkt.

  • :storage_type (atom/0) - Column type in the database
    May NOT be overridden using :constraints.

    Examples

      use AshGeo.Geometry, storage_type: :"geometry(Point,26918)"
  • :geo_types - Allowed Geo types

    Examples

      use AshGeo.Geometry, geo_types: :point
      use AshGeo.Geometry, geo_types: [:point, :point_z, :point_zm]
      use AshGeo.Geometry, geo_types: [:point, Geo.PointZ, :point_zm]

    See also

  • :force_srid (integer/0) - SRID to force on the geometry

    Examples

      use AshGeo.Geometry, force_srid: 4326
  • :check_srid (integer/0) - SRID to check on the geometry

    Examples

      use AshGeo.Geometry, check_srid: 4326

Summary

Functions

Try decoding with Geo.WKB and Geo.WKT, in the order specified by :prefer.

Functions

Link to this function

cast_input(value, constraints)

(since 0.1.0)

Try decoding with Geo.WKB and Geo.WKT, in the order specified by :prefer.