| 1234567891011121314151617 |
- {
- "7e883c3abc9fe2459f06f2a8cf0a5bff30b8a7f919a15c4d56311affd1da355f": {
- "original": "# Geo spatial functions\n\n### GEODIST()\n`GEODIST(lat1, lon1, lat2, lon2, [...])` function calculates the geosphere distance between two points specified by their coordinates. Note that by default, both latitudes and longitudes must be in **radians**, and the result will be in **meters**. You can use arbitrary expressions for any of the four coordinates. An optimized path will be chosen when one pair of arguments directly refers to a pair of attributes, and the other one is constant.\n\n`GEODIST()` also accepts an optional 5th argument, allowing you to easily convert between input and output units and select the specific geodistance formula to use. The complete syntax and a few examples are as follows:\n\nCODE_BLOCK_0\n\nThe known options and their values are:\n\n* `in = {deg | degrees | rad | radians}`, specifies the input units;\n* `out = {m | meters | km | kilometers | ft | feet | mi | miles | yd | yards | in | inch | cm | centimeters | mm | millimeters | NM | nmi | nauticalmiles}`, specifies the output units;\n* `method = {adaptive | haversine}`, specifies the geodistance calculation method.\n\nThe default method is \"adaptive\". It is a well-optimized implementation that is both more precise *and* much faster at all times than \"haversine\".\n\n### GEOPOLY2D()\n`GEOPOLY2D(lat1,lon1,lat2,lon2,lat3,lon3...)` creates a polygon to be used with the [CONTAINS()](../Functions/Arrays_and_conditions_functions.md#CONTAINS%28%29) function. This function takes into account the Earth's curvature by tessellating the polygon into smaller ones, and should be used for larger areas. For small areas, the [POLY2D()](../Functions/Geo_spatial_functions.md#POLY2D%28%29) function can be used instead. The function expects coordinates to be pairs of latitude/longitude coordinates in degrees; if radians are used, it will give the same result as `POLY2D()`.\n\n### POLY2D()\n`POLY2D(x1,y1,x2,y2,x3,y3...)` creates a polygon to be used with the [CONTAINS()](../Functions/Arrays_and_conditions_functions.md#CONTAINS%28%29) function. This polygon assumes a flat Earth, so it should not be too large; for large areas, the [GEOPOLY2D()](../Functions/Geo_spatial_functions.md#GEOPOLY2D%28%29) function, which takes Earth's curvature into consideration, should be used.\n\n<!-- proofread -->\n\n",
- "translations": {
- "chinese": "# \u5730\u7406\u7a7a\u95f4\u51fd\u6570\n\n### GEODIST()\n`GEODIST(lat1, lon1, lat2, lon2, [...])` \u51fd\u6570\u8ba1\u7b97\u7531\u5750\u6807\u6307\u5b9a\u7684\u4e24\u4e2a\u70b9\u4e4b\u95f4\u7684\u5730\u7403\u8868\u9762\u8ddd\u79bb\u3002\u8bf7\u6ce8\u610f\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u7eac\u5ea6\u548c\u7ecf\u5ea6\u90fd\u5fc5\u987b\u4ee5**\u5f27\u5ea6**\u4e3a\u5355\u4f4d\uff0c\u7ed3\u679c\u5c06\u4ee5**\u7c73**\u4e3a\u5355\u4f4d\u3002\u56db\u4e2a\u5750\u6807\u4e2d\u7684\u4efb\u4f55\u4e00\u4e2a\u90fd\u53ef\u4ee5\u4f7f\u7528\u4efb\u610f\u8868\u8fbe\u5f0f\u3002\u5f53\u4e00\u5bf9\u53c2\u6570\u76f4\u63a5\u5f15\u7528\u4e00\u5bf9\u5c5e\u6027\uff0c\u53e6\u4e00\u5bf9\u4e3a\u5e38\u6570\u65f6\uff0c\u5c06\u9009\u62e9\u4f18\u5316\u8def\u5f84\u3002\n\n`GEODIST()` \u8fd8\u63a5\u53d7\u53ef\u9009\u7684\u7b2c\u4e94\u4e2a\u53c2\u6570\uff0c\u4f7f\u60a8\u80fd\u591f\u8f7b\u677e\u5730\u5728\u8f93\u5165\u548c\u8f93\u51fa\u5355\u4f4d\u4e4b\u95f4\u8f6c\u6362\uff0c\u5e76\u9009\u62e9\u4f7f\u7528\u7684\u5177\u4f53\u5730\u7406\u8ddd\u79bb\u516c\u5f0f\u3002\u5b8c\u6574\u8bed\u6cd5\u548c\u51e0\u4e2a\u793a\u4f8b\u5982\u4e0b\uff1a\n\nCODE_BLOCK_0\n\n\u5df2\u77e5\u9009\u9879\u53ca\u5176\u53d6\u503c\u5982\u4e0b\uff1a\n\n* `in = {deg | degrees | rad | radians}`\uff0c\u6307\u5b9a\u8f93\u5165\u5355\u4f4d\uff1b\n* `out = {m | meters | km | kilometers | ft | feet | mi | miles | yd | yards | in | inch | cm | centimeters | mm | millimeters | NM | nmi | nauticalmiles}`\uff0c\u6307\u5b9a\u8f93\u51fa\u5355\u4f4d\uff1b\n* `method = {adaptive | haversine}`\uff0c\u6307\u5b9a\u5730\u7406\u8ddd\u79bb\u8ba1\u7b97\u65b9\u6cd5\u3002\n\n\u9ed8\u8ba4\u65b9\u6cd5\u4e3a\u201cadaptive\u201d\u3002\u8fd9\u662f\u4e00\u79cd\u7ecf\u8fc7\u826f\u597d\u4f18\u5316\u7684\u5b9e\u73b0\uff0c\u59cb\u7ec8\u6bd4\u201chaversine\u201d\u66f4\u7cbe\u786e\u4e14\u66f4\u5feb\u3002\n\n### GEOPOLY2D()\n`GEOPOLY2D(lat1,lon1,lat2,lon2,lat3,lon3...)` \u521b\u5efa\u4e00\u4e2a\u591a\u8fb9\u5f62\uff0c\u53ef\u7528\u4e8e [CONTAINS()](../Functions/Arrays_and_conditions_functions.md#CONTAINS%28%29) \u51fd\u6570\u3002\u8be5\u51fd\u6570\u901a\u8fc7\u5c06\u591a\u8fb9\u5f62\u5206\u5272\u6210\u66f4\u5c0f\u7684\u591a\u8fb9\u5f62\u6765\u8003\u8651\u5730\u7403\u7684\u66f2\u7387\uff0c\u9002\u7528\u4e8e\u8f83\u5927\u533a\u57df\u3002\u5bf9\u4e8e\u5c0f\u533a\u57df\uff0c\u53ef\u4ee5\u4f7f\u7528 [POLY2D()](../Functions/Geo_spatial_functions.md#POLY2D%28%29) \u51fd\u6570\u3002\u8be5\u51fd\u6570\u8981\u6c42\u5750\u6807\u4e3a\u4ee5\u5ea6\u4e3a\u5355\u4f4d\u7684\u4e00\u5bf9\u7eac\u5ea6/\u7ecf\u5ea6\u5750\u6807\uff1b\u5982\u679c\u4f7f\u7528\u5f27\u5ea6\uff0c\u5219\u7ed3\u679c\u4e0e `POLY2D()` \u76f8\u540c\u3002\n\n### POLY2D()\n`POLY2D(x1,y1,x2,y2,x3,y3...)` \u521b\u5efa\u4e00\u4e2a\u591a\u8fb9\u5f62\uff0c\u53ef\u7528\u4e8e [CONTAINS()](../Functions/Arrays_and_conditions_functions.md#CONTAINS%28%29) \u51fd\u6570\u3002\u6b64\u591a\u8fb9\u5f62\u5047\u8bbe\u5730\u7403\u662f\u5e73\u7684\uff0c\u56e0\u6b64\u4e0d\u5e94\u592a\u5927\uff1b\u5bf9\u4e8e\u5927\u9762\u79ef\u533a\u57df\uff0c\u5e94\u4f7f\u7528\u8003\u8651\u5730\u7403\u66f2\u7387\u7684 [GEOPOLY2D()](../Functions/Geo_spatial_functions.md#GEOPOLY2D%28%29) \u51fd\u6570\u3002\n\n<!-- proofread -->",
- "russian": "# \u0413\u0435\u043e\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438\n\n### GEODIST()\n`GEODIST(lat1, lon1, lat2, lon2, [...])` \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u0433\u0435\u043e\u0434\u0435\u0437\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u0442\u043e\u0447\u043a\u0430\u043c\u0438, \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0438\u0445 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c\u0438. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438 \u0448\u0438\u0440\u043e\u0442\u044b, \u0438 \u0434\u043e\u043b\u0433\u043e\u0442\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0432 **\u0440\u0430\u0434\u0438\u0430\u043d\u0430\u0445**, \u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0431\u0443\u0434\u0435\u0442 \u0432 **\u043c\u0435\u0442\u0440\u0430\u0445**. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0439 \u0438\u0437 \u0447\u0435\u0442\u044b\u0440\u0435\u0445 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442. \u041e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0440\u0430\u043d, \u043a\u043e\u0433\u0434\u0430 \u043e\u0434\u043d\u0430 \u043f\u0430\u0440\u0430 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0441\u0441\u044b\u043b\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u0430\u0440\u0443 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432, \u0430 \u0434\u0440\u0443\u0433\u0430\u044f \u2014 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043e\u0439.\n\n`GEODIST()` \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 5-\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u043b\u0435\u0433\u043a\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u0438 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u0438 \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0443\u044e \u0444\u043e\u0440\u043c\u0443\u043b\u0443 \u0433\u0435\u043e\u0434\u0435\u0437\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f. \u041f\u043e\u043b\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u043d\u0438\u0436\u0435:\n\nCODE_BLOCK_0\n\n\u0418\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0435 \u043e\u043f\u0446\u0438\u0438 \u0438 \u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f:\n\n* `in = {deg | degrees | rad | radians}`, \u0437\u0430\u0434\u0430\u0451\u0442 \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445;\n* `out = {m | meters | km | kilometers | ft | feet | mi | miles | yd | yards | in | inch | cm | centimeters | mm | millimeters | NM | nmi | nauticalmiles}`, \u0437\u0430\u0434\u0430\u0451\u0442 \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445;\n* `method = {adaptive | haversine}`, \u0437\u0430\u0434\u0430\u0451\u0442 \u043c\u0435\u0442\u043e\u0434 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0433\u0435\u043e\u0434\u0435\u0437\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u044f.\n\n\u041c\u0435\u0442\u043e\u0434 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u2014 \"adaptive\". \u042d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u0441\u0435\u0433\u0434\u0430 \u0442\u043e\u0447\u043d\u0435\u0435 *\u0438* \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0435\u043c \"haversine\".\n\n### GEOPOLY2D()\n`GEOPOLY2D(lat1,lon1,lat2,lon2,lat3,lon3...)` \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u043f\u043e\u043b\u0438\u0433\u043e\u043d, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 [CONTAINS()](../Functions/Arrays_and_conditions_functions.md#CONTAINS%28%29). \u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u043a\u0440\u0438\u0432\u0438\u0437\u043d\u0443 \u0417\u0435\u043c\u043b\u0438, \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u044f \u043f\u043e\u043b\u0438\u0433\u043e\u043d \u043d\u0430 \u043c\u0435\u043d\u044c\u0448\u0438\u0435 \u0447\u0430\u0441\u0442\u0438, \u0438 \u0434\u043e\u043b\u0436\u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0442\u0435\u0440\u0440\u0438\u0442\u043e\u0440\u0438\u0439. \u0414\u043b\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043f\u043b\u043e\u0449\u0430\u0434\u0435\u0439 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e [POLY2D()](../Functions/Geo_spatial_functions.md#POLY2D%28%29). \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u0436\u0438\u0434\u0430\u0435\u0442, \u0447\u0442\u043e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u2014 \u044d\u0442\u043e \u043f\u0430\u0440\u044b \u0448\u0438\u0440\u043e\u0442\u044b/\u0434\u043e\u043b\u0433\u043e\u0442\u044b \u0432 \u0433\u0440\u0430\u0434\u0443\u0441\u0430\u0445; \u0435\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0440\u0430\u0434\u0438\u0430\u043d\u044b, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0431\u0443\u0434\u0435\u0442 \u0442\u0430\u043a\u0438\u043c \u0436\u0435, \u043a\u0430\u043a \u0443 `POLY2D()`.\n\n### POLY2D()\n`POLY2D(x1,y1,x2,y2,x3,y3...)` \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u043f\u043e\u043b\u0438\u0433\u043e\u043d, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 [CONTAINS()](../Functions/Arrays_and_conditions_functions.md#CONTAINS%28%29). \u042d\u0442\u043e\u0442 \u043f\u043e\u043b\u0438\u0433\u043e\u043d \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442 \u043f\u043b\u043e\u0441\u043a\u0443\u044e \u0417\u0435\u043c\u043b\u044e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0433\u043e \u043f\u043b\u043e\u0449\u0430\u0434\u044c \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u043e\u0439; \u0434\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0442\u0435\u0440\u0440\u0438\u0442\u043e\u0440\u0438\u0439 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e [GEOPOLY2D()](../Functions/Geo_spatial_functions.md#GEOPOLY2D%28%29), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u043a\u0440\u0438\u0432\u0438\u0437\u043d\u0443 \u0417\u0435\u043c\u043b\u0438.\n\n<!-- proofread -->"
- },
- "is_code_or_comment": false,
- "model": "openai:gpt-4.1-mini",
- "updated_at": 1766339848
- },
- "__meta": {
- "source_text": "# Geo spatial functions\n\n### GEODIST()\n`GEODIST(lat1, lon1, lat2, lon2, [...])` function calculates the geosphere distance between two points specified by their coordinates. Note that by default, both latitudes and longitudes must be in **radians**, and the result will be in **meters**. You can use arbitrary expressions for any of the four coordinates. An optimized path will be chosen when one pair of arguments directly refers to a pair of attributes, and the other one is constant.\n\n`GEODIST()` also accepts an optional 5th argument, allowing you to easily convert between input and output units and select the specific geodistance formula to use. The complete syntax and a few examples are as follows:\n\n```sql\nGEODIST(lat1, lon1, lat2, lon2, { option=value, ... })\n\nGEODIST(40.7643929, -73.9997683, 40.7642578, -73.9994565, {in=degrees, out=feet})\n\nGEODIST(51.50, -0.12, 29.98, 31.13, {in=deg, out=mi})\n```\n\nThe known options and their values are:\n\n* `in = {deg | degrees | rad | radians}`, specifies the input units;\n* `out = {m | meters | km | kilometers | ft | feet | mi | miles | yd | yards | in | inch | cm | centimeters | mm | millimeters | NM | nmi | nauticalmiles}`, specifies the output units;\n* `method = {adaptive | haversine}`, specifies the geodistance calculation method.\n\nThe default method is \"adaptive\". It is a well-optimized implementation that is both more precise *and* much faster at all times than \"haversine\".\n\n### GEOPOLY2D()\n`GEOPOLY2D(lat1,lon1,lat2,lon2,lat3,lon3...)` creates a polygon to be used with the [CONTAINS()](../Functions/Arrays_and_conditions_functions.md#CONTAINS%28%29) function. This function takes into account the Earth's curvature by tessellating the polygon into smaller ones, and should be used for larger areas. For small areas, the [POLY2D()](../Functions/Geo_spatial_functions.md#POLY2D%28%29) function can be used instead. The function expects coordinates to be pairs of latitude/longitude coordinates in degrees; if radians are used, it will give the same result as `POLY2D()`.\n\n### POLY2D()\n`POLY2D(x1,y1,x2,y2,x3,y3...)` creates a polygon to be used with the [CONTAINS()](../Functions/Arrays_and_conditions_functions.md#CONTAINS%28%29) function. This polygon assumes a flat Earth, so it should not be too large; for large areas, the [GEOPOLY2D()](../Functions/Geo_spatial_functions.md#GEOPOLY2D%28%29) function, which takes Earth's curvature into consideration, should be used.\n\n<!-- proofread -->\n\n",
- "updated_at": 1768530797,
- "source_md5": "d1636edf973f5fc3c1788cbf74aafd4e"
- }
- }
|