今天听师妹讲了一篇论文,觉得还蛮有意思的。英文题目是《SVG-Based Spatial Information Representation and
Analysis》。这篇论文吸引人的地方是,将svg看成一个数据库,创建SQL查询。文中称为SSESQL,可以实现一些空间操作,比如RCC-8中定义的相邻,包含等关系的查询。下面是例子:
<svg viewBox=”94928 2172873 790615 595213” SRS=”xi’an80”>
<g id=”city”>
<path id=”C1” pop=”1500000” d=”…”/>
…
</g>
<g id=”river”>
<path id=”R1” length=”100” d=”…”/>
…
</g>
</svg>
The two layers expressed in the above SVG can be viewed as the following tables:
city (id, pop, d) and river (id, length, d). The following are some query examples.
1) Query example 1: List the cities which are crossed by the river “R1”.
SELECT c.id AS cid FROM river r, city c
WHERE r.id=”R1” AND Crosses(r.d, c.d)=True;
2) Query example 2: River “R1” can supply water for the cities, which are 40KM
around the river. List this kind of cities.
SELECT cy.id FROM city cy, river r
WHERE Overlap(cy.d, Buffer(r.d, 40))=True AND r.id=”R1”;
作者开发了一个编辑器,解析自定义的SSESQL。