mysql 表里的空间数据查询

空间数据查询

  • sql语句

    SELECT AsText(geom) FROM base_village WHERE id=1868
    
  • 表字段
    在这里插入图片描述

  • 查询结果
    在这里插入图片描述

  • 数据匹配

    -- 判断点与多面的关系
    SELECT ST_Intersects(st_GeometryFromText('POINT(114.125622 22.629471)'),
    st_GeometryFromText('MULTIPOLYGON(((114.125155 22.628037,114.12476 22.628571,114.125299 22.631256,114.125011 22.631406,
    114.124077 22.631006,114.123394 22.632007,114.124401 22.63239,114.124347 22.633258,114.124347 22.633358,114.124077 22.633641,
    114.123933 22.633758,114.123754 22.633658,114.123628 22.634141,114.12352 22.634425,114.123502 22.634575,114.123412 22.634625,
    114.123646 22.634759,114.123772 22.634959,114.123826 22.634975,114.123897 22.635009,114.123987 22.634892,114.124293 22.634825,
    114.12467 22.634909,114.124922 22.634909,114.125083 22.634692,114.125604 22.634792,114.127167 22.634442,114.126862 22.633908,
    114.129054 22.632007,114.125622 22.629471,114.125622 22.629471,114.125155 22.628037)))
    '));
    

你可能感兴趣的:(空间数据查询,mysql)