~zorba-coders/zorba/1189803-geoproj-module

« back to all changes in this revision

Viewing changes to test/Queries/geo/length8.xq

  • Committer: Juan Zacarias
  • Date: 2012-08-07 19:49:24 UTC
  • Revision ID: juan457@gmail.com-20120807194924-w8pmqsrf510fq3yv
Tags: zorba-2.8, zorba-2.9
RemovedĀ geosĀ module

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
(:
2
 
Geo module test.
3
 
Compute the length of the boundary of a polygon. 
4
 
The sum length of the external and internal rings is computed.
5
 
Result: 120
6
 
:)
7
 
 
8
 
import module namespace geo = "http://expath.org/ns/geo";
9
 
declare namespace gml="http://www.opengis.net/gml";
10
 
 
11
 
geo:length(<gml:Polygon>
12
 
              <gml:exterior>
13
 
                <gml:LinearRing><gml:posList>
14
 
                1 1 
15
 
                20 1 
16
 
                20 20 
17
 
                1 20 
18
 
                1 1
19
 
                </gml:posList></gml:LinearRing>
20
 
              </gml:exterior>
21
 
              <gml:interior>
22
 
                <gml:LinearRing><gml:posList>
23
 
                2 2 
24
 
                3 2 
25
 
                3 3 
26
 
                2 3 
27
 
                2 2
28
 
                </gml:posList></gml:LinearRing>
29
 
              </gml:interior>
30
 
              <gml:interior>
31
 
                <gml:LinearRing><gml:posList>
32
 
                10 10 
33
 
                20 10
34
 
                 20 20 
35
 
                 10 20 
36
 
                10 10
37
 
                </gml:posList></gml:LinearRing>
38
 
              </gml:interior>
39
 
              </gml:Polygon>)
40
 
              
 
 
b'\\ No newline at end of file'