You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class CreatePlaces < ActiveRecord::Migration[5.1]
def change
create_table :places do |t|
t.string :name
t.st_point :coords, :geographic => true
t.timestamps
end
change_table :places do |t|
t.index :coords, using: :gist
end
end
end
I get all places in following way:
class PlacesController < ApplicationController
def index
@places = Place.all
render json: @places.to_json
end
end
How can I parse / encode wkt?
I've got simple model of Places:
I get all places in following way:
But my JSON in response contains WKT:
I can map @places and encode coords like this:
And then I get what I wanted - encoded/parsed coords:
Is it right way to encode POINT?
The text was updated successfully, but these errors were encountered: