English 中文(简体)
如何在地图的边框中以度获得点数
原标题:How to get points in bounding box by degrees for map

我对BOX3D PostGIS 功能的工作有些担心,我试图在广场找到位置 -- -- 158.72136586889063 66.092751164148659, 154.60087122355937 52.56807575751039(度)。

    some_place.point && SetSRID( BOX3D(-158.721365889063 66.09275164148659,
    154.608712235937 52.56807548751039) ::box3d,4326)

返回两个可能方形中最大的位置。

当我改变角度的顺序或使用 xmin ymin, xmax ymax 顺序时,结果是一样的。

我也用过

     ST_Contains( SetSRID( ST_MakeBox2D( 
      ST_Point(143.930001298437,66.82980906973742), 
      ST_Point(-145.757498701563,51.37699768868392) ), 4326 ), some_place.point)

具有同样的结果。

我怎样才能按角度点的 具体顺序来做呢?

问题回答

Postgis 想要以下的 coorddiants :

ST_MakeBox2D(<LL>, <UR>)

LL指左下,UR指右上:

因此,对于你,这意味着:

some_place.point && SetSRID( BOX3D(154.608712235937  52.56807548751039,
-158.721365889063 66.09275164148659) ::box3d,4326)

ST_Contains( SetSRID( ST_MakeBox2D( 
  ST_Point(143.930001298437,51.37699768868392), 
  ST_Point(-145.757498701563,66.82980906973742) ), 4326 ), some_place.point)

如果您仍发现错误结果, 请尝试将查询分隔为 180 / - 179.9999999 度





相关问题
摘录数据

我如何将Excel板的数据输入我的Django应用? I m将PosgreSQL数据库作为数据库。

Postgres dump of only parts of tables for a dev snapshot

On production our database is a few hundred gigabytes in size. For development and testing, we need to create snapshots of this database that are functionally equivalent, but which are only 10 or 20 ...

How to join attributes in sql select statement?

I want to join few attributes in select statement as one for example select id, (name + + surname + + age) as info from users this doesn t work, how to do it? I m using postgreSQL.

What text encoding to use?

I need to setup my PostgreSQL DB s text encoding to handle non-American English characters that you d find showing up in languages such as German, Spanish, and French. What character encoding should ...

SQL LIKE condition to check for integer?

I am using a set of SQL LIKE conditions to go through the alphabet and list all items beginning with the appropriate letter, e.g. to get all books where the title starts with the letter "A": SELECT * ...

热门标签