Handling spatial data

I’m quite new in PHP and Yii, so any help will be much appreciated.

I have table in DB which represents routes, each route, one row. One of attributes is spatial mysql datatype "MULTIPLEPOINT". I would try to keep all points in the same table/row as route itself, rather then creating child table for points.

I don’t know how to handle it in the Yii Model file. After creating model with the help of gii, ‘points’ attribute is of course not handled. Should I have child class for points, although I don’t have corresponding database table for points, or I should just manually add some array of points in the route class/model ?

Thanks for any help :slight_smile:


  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,

  `userId` int(10) unsigned NOT NULL,

  `routeName` varchar(32) NOT NULL,

  `routeDescription` varchar(128) NOT NULL,

  `points` multipoint DEFAULT NULL,

  PRIMARY KEY (`id`),

  KEY `userId` (`userId`)