douhao2153
2012-04-25 02:41
浏览 38
已采纳

在Symfony 2 / Doctrine 2实体中存储空间点?

Symfony 2 doesn't have the spatial points datatype that MySQL supports. I couldn't find anything on the Doctrine 2 documentation about this particular data type, so, does anyone know how to work with points in Symfony 2? Also, how to query based on a radius? Thanks! :)

图片转代码服务由CSDN问答提供 功能建议

Symfony 2没有MySQL支持的空间点数据类型。 我在Doctrine 2文档中找不到关于这种特定数据类型的任何内容,那么,有没有人知道如何使用Symfony 2中的点? 另外,如何基于半径查询? 谢谢! :)

  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

3条回答 默认 最新

  • dongqin1861 2012-04-25 06:34
    已采纳

    The easiest way would be to implement custom types for the spatial data types, and then declare custom DQL functions to make querying them simpler.

    I wrote about this here: http://codeutopia.net/blog/2011/02/19/using-spatial-data-in-doctrine-2/

    打赏 评论
  • dpgvdfg321041670 2012-08-11 12:10

    If you speak french, youd could get some inspiration with another article here : http://blog.fastre.info/2012/02/doctrine2-2-2-et-types-geographiques/

    This classes were build for a Postgresql + Postgis Database.

    打赏 评论
  • dsyua2828 2014-10-24 19:41

    Another option would be to use the djlambert/doctrine2-spatial bundle, found here: https://github.com/creof/doctrine2-spatial

    No need to implement any custom stuff.

    打赏 评论

相关推荐 更多相似问题