1:- module(
2 wkt,
3 [
4 wkt_boundary/2, 5 wkt_contains/2, 6 wkt_convex_hull/2, 7 wkt_crosses/2, 8 wkt_difference/3, 9 wkt_disjoint/2, 10 wkt_distance/3, 11 wkt_envelope/2, 12 wkt_equals/2, 13 wkt_intersection/3, 14 wkt_intersects/2, 15 wkt_overlaps/2, 16 wkt_shape_atom/2, 17 wkt_symmetric_difference/3, 18 wkt_touches/2, 19 wkt_union/3, 20 wkt_within/2 21 ]
22).
28:- use_module(library(error)). 29:- use_module(library(shlib)). 30
31:- use_module(library(dcg)). 32:- use_module(library(geo)). 33:- use_module(library(wkt_generate)). 34:- use_module(library(wkt_parse)). 35
36:- use_foreign_library(foreign(geo)).
42wkt_boundary(Wkt, Boundary) :-
43 wkt_boundary_(Wkt, Boundary).
49wkt_contains(Wkt1, Wkt2) :-
50 wkt_contains_(Wkt1, Wkt2).
56wkt_convex_hull(Wkt, ConvexHull) :-
57 wkt_convex_hull_(Wkt, ConvexHull).
63wkt_crosses(Wkt1, Wkt2) :-
64 wkt_crosses_(Wkt1, Wkt2).
70wkt_difference(Wkt1, Wkt2, Difference) :-
71 wkt_difference_(Wkt1, Wkt2, Difference).
77wkt_disjoint(Wkt1, Wkt2) :-
78 wkt_disjoint_(Wkt1, Wkt2).
84wkt_distance(Wkt1, Wkt2, Distance) :-
85 wkt_distance_(Wkt1, Wkt2, Distance).
91wkt_envelope(Wkt, Envelope) :-
92 wkt_envelope_(Wkt, Envelope).
98wkt_equals(Wkt1, Wkt2) :-
99 wkt_equals_(Wkt1, Wkt2).
105wkt_intersection(Wkt1, Wkt2, Intersection) :-
106 wkt_intersection_(Wkt1, Wkt2, Intersection).
112wkt_intersects(Wkt1, Wkt2) :-
113 wkt_intersects_(Wkt1, Wkt2).
119wkt_overlaps(Wkt1, Wkt2) :-
120 wkt_overlaps_(Wkt1, Wkt2).
126wkt_shape_atom(Shape, Atom) :-
127 nonvar(Shape), !,
128 atom_phrase(wkt_generate(Shape), Atom).
129wkt_shape_atom(Shape, Atom) :-
130 nonvar(Atom), !,
131 atom_phrase(wkt_parse(Shape), Atom).
132wkt_shape_atom(Shape, Atom) :-
133 instantiation_error(args([Shape,Atom])).
139wkt_symmetric_difference(Wkt1, Wkt2, Difference) :-
140 wkt_symmetric_difference_(Wkt1, Wkt2, Difference).
146wkt_touches(Wkt1, Wkt2) :-
147 wkt_touches_(Wkt1, Wkt2).
153wkt_union(Wkt1, Wkt2, Wkt3) :-
154 wkt_union_(Wkt1, Wkt2, Wkt3).
160wkt_within(Wkt1, Wkt2) :-
161 wkt_within_(Wkt1, Wkt2)
Well-Known Text (WKT) support
*/