forked from couchbaselabs/erlgeom
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit ddb1e6c
Showing
3 changed files
with
690 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
Change the path in erlgeos.erl to your erlgeos.so file. The path is directly | ||
to the file without the .so extension (it must be an absolute path). | ||
|
||
Then compile the C and Erlang file: | ||
|
||
gcc -fPIC -g -Wall -shared -o erlgeos.so erlgeos.c -lgeos_c | ||
erlc erlgeos.erl | ||
|
||
Here's an example session in the erlang shell. See the erlgeos.erl file for | ||
more examples. | ||
|
||
$ erl | ||
Erlang R14B03 (erts-5.8.4) [source] [64-bit] [smp:4:4] [rq:4] [async-threads:0] [kernel-poll:false] | ||
|
||
Eshell V5.8.4 (abort with ^G) | ||
1> Geom1 = erlgeos:to_geom({'Point',[5,5]}). | ||
geom: POINT (5.0000000000000000 5.0000000000000000) | ||
<<>> | ||
2> Geom2 = erlgeos:to_geom({'LineString', [[1,1],[14,14]]}). | ||
geom: LINESTRING (1.0000000000000000 1.0000000000000000, 14.0000000000000000 14.0000000000000000) | ||
<<>> | ||
3> erlgeos:disjoint(Geom1, Geom2). | ||
false | ||
4> Geom3 = erlgeos:to_geom({'Point', [2.5,65.7]}). | ||
geom: POINT (2.5000000000000000 65.7000000000000028) | ||
<<>> | ||
5> erlgeos:disjoint(Geom1, Geom3). | ||
true | ||
6> |
Oops, something went wrong.