带有postgis的dblink postgresql中的linestring不起作用

时间:2012-06-29 13:56:44

标签: postgresql postgis dblink

我正在尝试使用postgis函数进行dblink,但是linetring给了我很多问题。

SELECT 
    DV3."XXX",
        s."QQQID",s."X",s."Y",a."PPP"
FROM 
    "QQQ" s INNER JOIN "AAA" a ON a."QQQID" = s."QQQID",
    dblink('dbname=ZZZ',
        'SELECT XXX,the_geom 
        FROM "geometry", "QQQ" s 
        WHERE box2d(geomfromtext(''LINESTRING('|| s."X" ||' '||s."Y" ||','|| s."X" || ' '||s."Y" || ')'',2309))
        && the_geom'
                           ) 
        DV3("XXX" INTEGER,"the_geom"  geometry)


WHERE 
    contains(DV3.the_geom,geomfromtext('POINT('|| s."X" ||' '|| s."Y" ||')',2309))--21
    AND "GGG" IS NOT NULL

ERROR

  

LINE 9:... WHERE box2d(geomfromtext(''LINESTRING('|| s。“X”+ 0 ....

1 个答案:

答案 0 :(得分:2)

根据Tanzeeb的说法,有两个单引号紧挨着两个实例,看起来应该是双引号而不是两个单引号。

    'SELECT XXX,the_geom 
    FROM "geometry", "QQQ" s 
    WHERE box2d(geomfromtext(''LINESTRING('|| s."X" ||' '||s."Y" ||','|| s."X" || ' '||s."Y" || ')'',2309))
    && the_geom'

在LINESTRING之前和之前,2309。