dougang1965 2018-02-05 07:06
浏览 95

如何将映射的边界框传递给SetFilterFloatRange()?

I get bounding_box of map SW, NE which gives me array of 4 coordinates or lt/ln. I want to pass this to SetFilterFloatRange().

Purpose of doing this is, I want to get filtered results only which fall in this bounding box area or from visible portion of map.

I have below questions

  1. How to pass it to SetFilterFloatRange() because it accepts only 2 params of lt/ln

    Ref : http://php.net/manual/en/sphinxclient.setfilterfloatrange.php

  2. I think I need to convert these coordinates to radians before passing to above method. Correct me, if wrong.

  • 写回答

1条回答 默认 最新

  • douci1918 2018-02-05 07:34
    关注

    How to pass it to SetFilterFloatRange() because it accepts only 2 params of lt/ln

    I assume you have 2 attributes:

    • latitude
    • longitude

    in your index and you have an array of 4 lt/ln corner coordinates of the area you want to filter by. And you want to find only those documents that are inside you box area. Then you first need to convert the array to 4 values:

    • min latitude
    • max latitude
    • min longitude
    • max longitude

    and then set 2 filters:

    • SetFilterFloatRange('latitude', $min_lt, $max_lt);
    • SetFilterFloatRange('longitude', $min_ln, $max_ln);

    I need to convert these coordinates to radians before passing to above method

    If you have the indexed coordinates in radians - yes, the function itself doesn't care about radians/degrees, it's just that the indexed values and values you pass to the fuction should be compatible.

    评论

报告相同问题?

悬赏问题

  • ¥15 MATLAB怎么通过柱坐标变换画开口是圆形的旋转抛物面?
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题
  • ¥15 Visual Studio问题
  • ¥20 求一个html代码,有偿