Skip to content

请问最新版本的Addax是否支持Postgres空间数据库的Geometry类型 #935

Answered by wgzhao
snowfield516 asked this question in Q&A
Discussion options

You must be logged in to vote

如果只是读取 postgresql 里的 geometry 类型数据,你可以在 column 里使用 ST_AsText(geom) 方式来读取数据,假定有如下的表以及相应的数据

CREATE TABLE geometries (name varchar, geom geometry);

INSERT INTO geometries VALUES
  ('Point', 'POINT(0 0)'),
  ('Linestring', 'LINESTRING(0 0, 1 1, 2 1, 2 2)'),
  ('Polygon', 'POLYGON((0 0, 1 0, 1 1, 0 1, 0 0))'),
  ('PolygonWithHole', 'POLYGON((0 0, 10 0, 10 10, 0 10, 0 0),(1 1, 1 2, 2 2, 2 1, 1 1))'),
  ('Collection', 'GEOMETRYCOLLECTION(POINT(2 0),POLYGON((0 0, 1 0, 1 1, 0 1, 0 0)))');

你可以使用如下的配置文件来读取上述表的内容

    {
      "job": {
        "setting": {
          "speed": {
            "byte": -1,
            "channel": 1
          }
        },
        "content": [
          {
            "reader":…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@snowfield516
Comment options

Answer selected by snowfield516
Comment options

You must be logged in to vote
1 reply
@snowfield516
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants