-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
148 lines (94 loc) · 4.31 KB
/
README
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
142
143
144
145
146
147
148
ABOUT
=====
Readme for GeoTiffOvl
* MP Sonnemann <[email protected]>
* License: GPL v2 or later
GeoTiffOvl displays a georeferenced Tiff image correctly aligned and scaled
alongside with other geo layers.
SETUP
=====
You need a working GDAL installation with Java bindings. If your system has pre-
packaged binaries, use them. But most likely you will have to compile them from
source. Windows users may want to get binaries from http://fwtools.maptools.org/
and join me again after the next step.
COMPILING GDAL FROM SOURCE (Linux)
----------------------------------
Pre-requisites may include: PROJ.4, gcc, checkinstall and a lot more. You will
see it as soon the compiler complains.
Uninstall previous versions of GDAL/OGR, if you have any.
Download the latest version from http://trac.osgeo.org/gdal/wiki/DownloadSource
You will need the one labeled "source as .tar.gz".
From now on, you will need a terminal. Everything prefixed with a dollar sign ($)
needs to be typed into that terminal.
Open your terminal and change to the directory where you saved the archive.
Extract it via
$ tar xvf gdal-XYZ.tar.gz
into the current directory, then configure it by typing
$ cd gdal-XYZ
$ ./configure
(for more options, see ./configure --help).
Now, compile it:
$ make
Grab a coffee. Once it has finished, install your new library. If you are on a
Debian system (Ubuntu is one!), you may issue checkinstall to integrate it with
apt and enable clean uninstalls:
$ sudo checkinstall
all others may get lucky with
$ sudo make install
but only if you got root :)
Finally, it is time to build the Java bindings.
$ cd swig/java
Open the file java.opt, check if JAVA_HOME is set to your JVM path, e.g.
/usr/lib/default-java. Adjust, if needed. Then compile the code:
$ make
And install it
$ sudo checkinstall
or via
$ sudo make install
Congratulations!
You may want to check if everything works by typing
$ gdalinfo
That confirms that the native library is working.
Check your Java bindings by executing the following command inside the swig/java
directory:
$ export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:`pwd`
$ java -classpath `pwd`/gdal.jar:`pwd`:`pwd`/apps GDALtest
Load a georeferenced image and hope for the best.
COMPILING GEOTIFFOVL FROM SOURCE
--------------------------------
If you have the JOSM-plugin repo checked out, then place it there under plugins.
If you haven't, then you have to take care to place the directory geotiffovl
two directories deep, meaning:
+--- geotiff-plugin
+-- src <-- NEEDED! name is irrelevant
|-- geotiffovl <-- place source here
This is necessary because ant will place the jar under '../../dist' - in this
case, geotiff-plugin/dist - clobbering happily anything that lies in its path.
Run ant inside the geotiffovl directory.
$ ant install
will compile the sources, create a JAR file and place it inside your JOSM plugin-
directory.
Start JOSM, go to the preferences (Edit->Preferences or <F12>). Click on the icon
with the power plug and type geotiffovl into the search box. Only one plugin
named geotiffovl should be visible. Enable it by ticking the check box. Restart
JOSM.
Now you will have another menu entry: "GeoTiff". Click it to add a new image
layer. Have fun!
If the plugin will not start, complaining about a ClassNotFoundException for
org.gdal.gdal.gdal, then you will have to supply the dir where gdal.jar is
located to the VM via the switch -Djava.ext.dirs=/path/to/gdal.jar/dir. Or you
may hard-wire the location into the build.xml: Open the build.xml file inside
the geotiffovl directory and search for the word "Class-Path". Locate gdal.jar
on your system and provide it there.
TROUBLESHOOTING
===============
PROBLEM: Java complains about some JNI stuff!
RESOLUTION: Check if the file libgdaljni.so/libgdaljni.dll is in your path.
Either adjust the path environment variable, add it to your
LD_LIBRARY_PATH if you are on Linux, or start JOSM with the following
switches to the java VM: -Djava.library.path=/path/to/gdallibs
PROBLEM: Red text has appeared instead of my image!
RESOLUTION: Oh dear, that's not good. What's it say? Either you are using a
non-standard geographic projection (no EPSG code), or your image is
trashed, or something else is scrambling your bits.
You know how to debug?