在几何列中查询(由kml文件创建)? [英] Query in a geometry column (created by kml file)?

查看:97
本文介绍了在几何列中查询(由kml文件创建)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果您使用

包含忽略大小写

contains ignore case

然后查询将返回数据,但返回速度很慢.

then the query will return the data, but does so slowly.

如何在融合表的几何列中查询?

How I can query in a geometry column in a fusion table?

我用Google Maps创建了一个kml文件,该文件已导入到Google Fusion表中.当我尝试搜索经度& geometry列中的纬度",以返回经度&折线内一个或多个点的纬度匹配.

I created a kml file with Google Maps, which was imported to Google fusion table. When I try to search the longitude & latitude in the column geometry to return the names of the zones where longitude & latitude match in one or more points inside the polyline.

在我的情况下,几何"列存储这样的一条折线:

The geometry column in my case stores a polyline like this:

当前单元格值:

<LineString><coordinates>
-99.832771,16.88472,0.0
-99.832703,16.88558,0.0
-99.832703,16.88558,0.0
-99.831383,16.885441,0.0 
..... 
</coordinates></LineString>

现在我尝试查询tableid = 3427749:

http://fusiontables.googleusercontent.com/fusiontables/api/query?sql=
SELECT name FROM 3427749 
WHERE ST_INTERSECTS('geometry',RECTANGLE(LATLNG(32.618591,-115.441528),LATLNG(31.954109,-115.212509)))

并返回 void ,但是如果您尝试在矩形中绘制相同的坐标,则可以很好地看到它,如果您查看表格,则该区域包含我查询的有效坐标.

and return void but if you try paint the same coordinates in a rectangle you can see it well and if you look the table, this region contains valid coordinates for my query.

绘制相同区域:

 var boudns = new google.maps.LatLngBounds(new google.maps.LatLng(32.618591, -115.441528),    new google.maps.LatLng(31.954109,-115.212509));

 var rectOptions = {
          strokeColor: "#000000",
          strokeOpacity: 0.6,
          strokeWeight: 2,
          fillColor: "#000000",
          fillOpacity: 0.2,
          bounds: boudns
        };
 rect.setOptions(rectOptions);

 var myOptions = {
      center: new google.maps.LatLng(23.926013,-101.90918),
      zoom: 5,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    }
 map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);

 rect.setMap(map);

//You need implement a div with id map_canvas and put the code in `<script>` tags.


怎么了?有什么帮助吗?


What is wrong? Any help, please?

推荐答案

您在搜索RECTANGLE中的纬度有误.

You have your latitudes wrong in your search RECTANGLE.

FT SELECT参考文档

The syntax is: RECTANGLE(<lower_left_corner>, <upper_right_corner>)

您有:

ST_INTERSECTS('geometry',RECTANGLE(LATLNG(32.618591,-115.441528),LATLNG(31.954109,-115.212509)))

纬度32.618591> 31.954109 当我切换这些纬度并运行您的查询时,我得到一个名字"Mexicali-El Faro"

Latitude 32.618591 > 31.954109 When I switched these latitudes and ran your query I got one name "Mexicali - El Faro"

这篇关于在几何列中查询(由kml文件创建)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆