1

有没有办法以这种格式从我的 postgis 数据库中返回线串?

Line: 1, "Road" 35.62200200, -88.98259200 35.62203500, -88.98240800 35.62202700, -88.98231000 35.62180000, -88.98163400 35.62175700, -88.98149000 35.62172500, -88.97881200 35.62172000, -88.97798500 35.62169800, -88.97752400 35.62170300, -88.97736200 35.62173900, -88.97723200 35.62180600, - 88.97715200 35.62292600, -88.97608000 35.62467700, -88.97441600 35.62482100, -88.97429800 结束:

4

3 回答 3

3

你应该连接xy的

LINESTRING('|| s."X" ||' '||s."Y" ||','|| s."X" || ' '||s."Y" || ')'' ,2309)

希望对你也有用:)

于 2012-07-02T21:39:58.333 回答
0

你有自定义格式,还是已知的?有几个几何输出函数,你总是可以将它们的输出解析成新的东西,例如:

SELECT 'Line: ' || id || ', ' ||
  trim(translate(ST_AsText(ST_FlipCoordinates(ST_Transform(the_geom, 4326))),
                 'MULTILINESTRINGZM()', '')) || ' End:' AS output
FROM nqatrkl;

或者您可以转储积分并以其他方式修改它们:

SELECT id, time, (d).path, (d).path[1] AS part,
       ST_Y((d).geom) AS lat, ST_X((d).geom) AS lon
FROM (SELECT id, time, ST_DumpPoints(ST_Transform(the_geom, 4326)) AS d
      FROM nqatrkl) AS foo
ORDER BY (d).path;
于 2012-07-04T04:18:35.203 回答
0

这对我有用,它是一种自定义格式,还是已知的?有几个几何输出函数,你总是可以将它们的输出解析成新的东西,例如:

SELECT 'Line: ' || id || ', ' ||
  trim(translate(ST_AsText(ST_FlipCoordinates(ST_Transform(the_geom, 4326))),
                 'MULTILINESTRINGZM()', '')) || ' End:' AS output
FROM nqatrkl;

或者您可以转储积分并以其他方式修改它们:

SELECT id, time, (d).path, (d).path[1] AS part,
       ST_Y((d).geom) AS lat, ST_X((d).geom) AS lon
FROM (SELECT id, time, ST_DumpPoints(ST_Transform(the_geom, 4326)) AS d
      FROM nqatrkl) AS foo
ORDER BY (d).path;
于 2012-07-13T05:54:37.383 回答