Skip to content

RGeo default factory cannot be set #66

@camiloforero

Description

@camiloforero

module Geospatial
# Wrapper to Rgeo's Point
Point.class_eval do
#
# With RGeo support
#
# @return (RGeo::SphericalFactory::Point)
def to_rgeo
RGeo::Geographic.spherical_factory.point x, y
end

Here, and everywhere else, the spherical_factory is being used to convert geometries from geospatial Objects into RGeos objects. However, this may not always be the best choice.

The library geo_json already has a solution, that may serve as a guide:

https://github.com/rgeo/rgeo-geojson/blob/6c76aced209969692a51364d6765b45c61eabf08/lib/rgeo/geo_json/coder.rb#L23-L24

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions