-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathstarspan.in
executable file
·142 lines (121 loc) · 3.78 KB
/
starspan.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
#!@SH@
#
# starspan - launcher script
# $Id: starspan.in,v 1.10 2008-03-04 01:27:31 crueda Exp $
#
BINDIR=`dirname $0`
# The proper StarSpan binary:
STARSPAN2=$BINDIR/@program_prefix@starspan2@program_suffix@
export LD_LIBRARY_PATH=@GDAL_PREFIX@/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=@GEOS_PREFIX@/lib:$LD_LIBRARY_PATH
# mainly for --run command
export PATH=@GDAL_PREFIX@/bin:@GEOS_PREFIX@/bin:$PATH
# $JARS: For convenience, the jars in this directory are included in the
# CLASSPATH for running the java based commands. Whether you use this directory
# or not, the following jars should be accessible:
#
# Required by the --gui option:
# guie.jar
# starspan.guie
# guie.jar can be downloaded from https://sourceforge.net/project/showfiles.php?group_id=141010
#
# Required by the --view_geometries option:
# plotapplication.jar
# Can be download from http://ptolemy.eecs.berkeley.edu/java/ptplot
# Tested with version 5.6.
#
# Required by the --test and --jts options:
# xerces.jar
# jts-1.8.jar
# jdom.jar
# JTS_Test.jar
# acme.jar
# These can be downloaded from http://www.vividsolutions.com/jts/jtshome.htm
# Tested with version JTS 1.8.
#
JARS=$BINDIR/starspan.jars/
usage() {
cat << EOF
starspan extended usage:
starspan --gui
launches the StarSpan GUI
starspan --view_geometries dumped_geometries.csv
launches the ptPlot application with the given file.
Normally dumped_geometries.csv was generated by
"starspan --dump_geometries dumped_geometries.csv ..."
starspan --test args...
launches the JTS Test Runner
Typically this is called:
starspan --test -files a_test.xml
where a_test.xml was generated by "starspan --jtstest a_test.xml ..."
starspan --jts
launches the JTS Test Builder as a way to visualize the
geometries involved in tests.
Choose "File->Open XML file(s)..." to open an .xml file
generated by "starspan --jtstest ..."
starspan --run cmd args ...
Runs a command under the same environment as that of the
StarSpan system.
E.g. starspan --run ogrinfo -al a_vector_file
EOF
return;
}
if [ "$1" = "--xhelp" ]; then
usage
exit
elif [ "$1" = "--gui" ]; then
echo "[Launching StarSpan GUI...]"
if [ ! -x `which java` ]; then
echo "Command 'java' is required to launch this application."
exit 1
fi
if [ ! -f $BINDIR/starspan.guie ]; then
echo "Cannot open $BINDIR/starspan.guie"
exit 1
fi
shift
CP=$CLASSPATH
CP=$JARS/guie.jar:$CP
java -Xmx256m -cp "$CP" guie.Guie $BINDIR/starspan.guie "$@"
ret=$?
if [ "$ret" != 0 ]; then
echo "[exit code=$ret -- a missing component in your classpath?]"
fi
elif [ "$1" = "--view_geometries" ]; then
echo "[Launching ptplot...]"
shift
CP=$CLASSPATH
CP=$JARS/plotapplication.jar:$CP
java -Xmx256m -cp "$CP" ptolemy.plot.PlotApplication "$@"
ret=$?
if [ "$ret" != 0 ]; then
echo "[exit code=$ret -- a missing component in your classpath?]"
fi
elif [ "$1" = "--test" ]; then
echo "[Launching JTS TopologyTestApp...]"
shift
CP=$CLASSPATH
for i in $JARS/*.jar; do CP=$i:$CP; done
java -Xmx256m -cp "$CP" com.vividsolutions.jtstest.testrunner.TopologyTestApp "$@"
ret=$?
if [ "$ret" != 0 ]; then
echo "[exit code=$ret -- a missing component in your classpath?]"
fi
elif [ "$1" = "--jts" ]; then
echo "[Launching JTSTestBuilder...]"
shift
CP=$CLASSPATH
for i in $JARS/*.jar; do CP=$i:$CP; done
java -Xmx256m -cp "$CP" com.vividsolutions.jtstest.testbuilder.JTSTestBuilder "$@"
ret=$?
if [ "$ret" != 0 ]; then
echo "[exit code=$ret -- a missing component in your classpath?]"
fi
elif [ "$1" = "--run" ]; then
shift
echo "[Running " "$@" "]"
"$@"
else
# call starspan2
$STARSPAN2 "$@"
fi