gis - How to store room shape data in Rails? -


i'm writing rails app needs store shape data representing floor plans of public spaces. spaces churches , concert halls. many shapes simple ("fans" or "shoeboxes") more complex (e.g. like this).

i'm new rails , totally new gis applications. (is gis problem? i'm not sure.)

can suggest sort of data type should use store information in database? should room shapes stored polygons? or there more appropriate data type, such 1 can more accurately represent curved surfaces found in some venues?

this not efficient way might start out defining models such as:

class path     has_many :nodes end  class node     attr_accessible :x, :y, :next_id     belongs_to :next, class_name: 'node'     has_one :arc_extension end  class arcextension     attr_accessible :radius, :x1, :y1, :x2, :y2     belongs_to :node end 

a path collection of nodes. each node store coordinates of point on path along id of next node in path. if want node represent beginning of arc, can create arc extension node. arc_extension might store radius of arc along 2 reference points needed construct arc. reference on how these reference points might defined, might arcto method used in html5 canvas: http://dbp-consulting.com/tutorials/canvas/canvasarcto.html .

you should able change method bit if want represent other types of curved paths (such bezier curves).


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -