Skip to content

RGeo::Geographic::SphericalPointImpl return nil #289

@Tioneb12

Description

@Tioneb12

pry(main)> p = Poi.last

 Poi Load (0.3ms)  SELECT  "pois".* FROM "pois" ORDER BY "pois"."id" DESC LIMIT $1  [["LIMIT", 1]]
=> #<Poi:0x00007fed8f6aefa8
 id: 7,
 latitude: 44.56,
 longitude: 2.37,
 lonlat: #<RGeo::Geographic::SphericalPointImpl:0x3ff6c7b2a7e8 "POINT (2.3749903 44.56567829999999)">

"lonlat" is not empty but...

pry(main)> p.lonlat => nil

for some method, "lonlat" work fine... for other not, for exemple :

respond_to do |format|
  format.html
  format.json { render json: { type: 'FeatureCollection', features: Poi.pois_geojson(@pois) }}

return :

    {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "Point",
        "coordinates": null
      }
    }

Why ? What's wrong ?

Thanks for your help

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions