Coder Social home page Coder Social logo

Comments (1)

zkbtHuangw avatar zkbtHuangw commented on June 14, 2024

把tbase版本降到2.1.0后,select * from spatial_ref_sys能查出数据,
SELECT ST_Distance(
ST_GEOMFROMTEXT('POINT(113.907783490367706 22.39120737493609)',4326),
ST_GEOMFROMTEXT('POINT(113.907783490367706 23.39120737493609)',4326)
);

SELECT ST_Distance(
ST_GEOMFROMTEXT('POINT(113.907783490367706 22.39120737493609)',4326)::geography,
ST_GEOMFROMTEXT('POINT(113.907783490367706 23.39120737493609)',4326)::geography
);
都能正确输出结果,但如果是查表,
SELECT ST_Distance(t.geo_detail::geography, ST_GeomFromText('POINT(0 1)', 4326)::geography) from test_geom t where t.geo_id=3;

SELECT ST_Distance(t.geo_detail, ST_GeomFromText('POINT(0 1)', 4326)) from test_geom t where t.geo_id=3;
只有平面几何才能正确计算,球面计算就会报错:
ERROR: node:dn001, backend_pid:1739835, nodename:dn001,backend_pid:1739835,message:Cannot find SRID (4326) in spatial_ref_sys
SQL state: XX000

from tbase.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.