从Postgis获取投影限制 [英] Get projection limits from Postgis

查看:551
本文介绍了从Postgis获取投影限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我以纬度/经度坐标对形式接收对API的空间查询.我的空间数据处于无法覆盖整个地球的投影中,因此某些查询超出了范围.

I receive spatial queries to my API in lat/lon coordinate pairs. My spatial data is in projections that don't cover the entire globe, which follows that some queries are out of bounds.

我想通过有用的错误消息来响应错误的查询.与其尝试在GIS规范或标准中找出每个投影的边界(并从中获取正确的经纬度对),不如想知道我是否可以从Postgis询问极限值或询问特定点是否在限制范围内,以什么方式是错误的.这样,我可以轻松地支持许多预测.

I'd like to respond to wrong queries with helpful error message. Rather than try to find out some in GIS specifications or standards what boundaries each projection has (and getting correct lat/lon pairs from those), I'd like to know wether I could either ask the limits from Postgis or ask if specific point is within limits and in what way it's wrong. This way I could support many projections easily.

Postgis似乎拥有此信息,因为对于错误的查询,它会回答:

It looks like Postgis has this information because for wrong query it answers thus:

transform: couldn't project point (-77.0331 -12.1251 0):
    latitude or longitude exceeded limits (-14)

我正在通过Geodjango距离查询(django.contrib.gis.geos.geometry.GEOSGeometry.distance函数)使用Postgis.

I'm using Postgis through Geodjango distance query (django.contrib.gis.geos.geometry.GEOSGeometry.distance function).

推荐答案

PostGIS或PROJ.4(遵循

PostGIS or PROJ.4 (follow this thread) don't have these bounds. Each projection's bounds are unique, and are traditionally published by the authority that designed the projection.

此数据的主要来源之一是 https://www.epsg-registry.org 点击按代码检索"和(例如)27200,然后查看使用范围"字段.

One of the primary sources for this data is from https://www.epsg-registry.org click "retrieve by code" and (e.g.) 27200, and view the "Area of Use" fields.

许多相同的信息在(例如) http://epsg.io/27200 处重复,然后表示界限".

Much of the same information is repeated at (e.g.) http://epsg.io/27200 and look for "bounds".

如果需要此数据,建议您创建一个新表来收集它.

If you need this data, I suggest you make a new table to collect it.

这篇关于从Postgis获取投影限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆