我有一个视图 openstreetmapview,它结合了两个具有不同列的表。第一个表是openstreetmap,第二个是B。
当我在视图上执行此查询时:
select this_.gid as y0_
, this_.openstreetmapId as y1_
, this_.name as y2_
, this_.streetType as y3_
, this_.oneWay as y4_
, this_.location as y5_
, this_.isIn as y6_
, this_.countryCode as y7_
, length as y8_
, distance_sphere(
GeometryFromText(
'POINT(11.059734344482422 46.07373046875)',4326)
, ST_line_interpolate_point(
this_.shape
, st_line_locate_point(
this_.shape
, GeometryFromText('POINT(11.059734344482422 46.07373046875)', 4326)
)
)
) as y9_
, ST_AsText(ST_ClosestPoint(
this_.shape,GeometryFromText( 'POINT(11.059734344482422 46.07373046875)', 4326)
)) as y10_
from OpenStreetMapView this_ ;
然后,我得到大约 50k 个结果。当我在表上执行相同的查询时,即使表具有查询所需的相同列,它也会返回 0 行。这是为什么?
我使用 PostgreSQL 8.4 数据库和 PostGIS 。