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

RGeo default factory cannot be set #66

Open
camiloforero opened this issue Oct 17, 2018 · 0 comments
Open

RGeo default factory cannot be set #66

camiloforero opened this issue Oct 17, 2018 · 0 comments
Labels

Comments

@camiloforero
Copy link

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

@dblock dblock added the chore label Oct 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants