Skip to content

Commit f8c78a8

Browse files
committed
Merge branch 'master' into 0.3
2 parents 1d189e5 + e119277 commit f8c78a8

File tree

63 files changed

+2242
-2285
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+2242
-2285
lines changed

.github/CONTRIBUTING.md

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
Submit a new issue only if you are sure it is a missing feature or a bug. Otherwise please discuss the topic in the [mailing list](https://lists.openstreetmap.org/listinfo/photon) first.
2+
3+
## We love pull requests. Here's a quick guide:
4+
5+
1. [Fork the repo](https://help.github.com/articles/fork-a-repo) and create a branch for your new feature or bug fix.
6+
7+
2. Run the tests. We only take pull requests with passing tests: `mvn clean test`
8+
9+
3. Add at least one test for your change. Only refactoring and documentation changes
10+
require no new tests. Also make sure you submit a change specific to exactly one issue. If you have ideas for multiple
11+
changes please create separate pull requests.
12+
13+
4. Make the test(s) pass.
14+
15+
5. Push to your fork and [submit a pull request](https://help.github.com/articles/using-pull-requests). A button should
16+
appear on your fork its github page afterwards.
17+
18+
## Code formatting
19+
20+
We use IntelliJ defaults and a very similar configuration for NetBeans defined in the root pom.xml. For eclipse there is this [configuration](https://github.com/graphhopper/graphhopper/files/481920/GraphHopper.Formatter.zip). Also for other IDEs
21+
it should be simple to match:
22+
23+
* Java indent is 4 spaces
24+
* Line width is 100 characters
25+
* The rest is left to Java coding standards but disable "auto-format on save" to prevent unnecessary format changes.
26+
* Currently we do not care about import section that much, avoid changing it
27+
* Unix line endings (should be handled via git)
28+
29+
And in case we didn't emphasize it enough: we love tests!

.travis.yml

-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,3 @@ language: java
33
jdk:
44
- oraclejdk8
55
- oraclejdk9
6-
7-
matrix:
8-
allow_failures:
9-
- jdk: oraclejdk9

README.md

+18-17
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,13 @@ Feel free to test and participate!
2424

2525
photon requires java, at least version 8.
2626

27-
get photon
27+
Get photon, at least 0.3, from [the releases](https://github.com/komoot/photon/releases) and start it:
28+
2829
```bash
29-
wget http://photon.komoot.de/data/photon-0.2.7.jar
30+
java -jar photon-*.jar
3031
```
3132

32-
download search index (31G gb compressed, 56.3 gb uncompressed, worldwide coverage, languages: English, German, French and Italian). The search index is updated weekly and thankfully provided by [graphhopper](https://graphhopper.com/) with the support of [lonvia](https://github.com/lonvia).
33+
Download the search index (53G gb compressed, worldwide coverage, languages: English, German, French and Italian). The search index is updated weekly and thankfully provided by [GraphHopper](https://www.graphhopper.com/) with the support of [lonvia](https://github.com/lonvia).
3334

3435
Make sure you have bzip2 or pbzip2 installed and execute one of these two commands in your shell. This will download, uncompress and extract the huge database in one step:
3536

@@ -38,24 +39,28 @@ wget -O - http://download1.graphhopper.com/public/photon-db-latest.tar.bz2 | bzi
3839
# you can significantly speed up extracting using pbzip2 (recommended):
3940
wget -O - http://download1.graphhopper.com/public/photon-db-latest.tar.bz2 | pbzip2 -cd | tar x
4041
```
41-
42-
start photon
43-
```bash
44-
java -jar photon-0.2.7.jar
45-
```
4642

47-
Check the URL `http://localhost:2322/api?q=berlin` to see if photon is running without problems. You may want to use our [leaflet plugin](https://github.com/komoot/leaflet.photon) to see the results on a map.
43+
To use an older version of ElasticSearch please download the data from [here](http://download1.graphhopper.com/public/photon-ES-17-db-171019.tar.bz2) (Nov 2017) via wget as described above and use version [0.2.7 of photon](http://photon.komoot.de/data/photon-0.2.7.jar) (Oct 2016).
4844

49-
discover more of photon's feature with its usage `java -jar photon-0.2.7.jar -h`.
45+
Check the URL `http://localhost:2322/api?q=berlin` to see if photon is running without problems. You may want to use our [leaflet plugin](https://github.com/komoot/leaflet.photon) to see the results on a map.
5046

47+
discover more of photon's feature with its usage `java -jar photon-*.jar -h`.
5148

5249

5350
### Customized Search Data
5451
If you need search data in other languages or restricted to a country you will need to create your search data by your own.
55-
Once you have your [nominatim](https://github.com/twain47/Nominatim) database ready, you can import the data to photon:
52+
Once you have your [nominatim](https://github.com/twain47/Nominatim) database ready, you can import the data to photon.
5653

54+
If you haven't already set a password for your nominatim database user, do it now (change user name and password as you like, below):
55+
56+
```bash
57+
su postgres
58+
psql
59+
ALTER USER nominatim WITH ENCRYPTED PASSWORD 'mysecretpassword';
60+
```
61+
Import the data to photon:
5762
```bash
58-
java -jar photon-0.2.7.jar -nominatim-import -host localhost -port 5432 -database nominatim -user nominatim -password ... -languages es,fr
63+
java -jar photon-*.jar -nominatim-import -host localhost -port 5432 -database nominatim -user nominatim -password mysecretpassword -languages es,fr
5964
```
6065

6166
The import of worldwide data set will take some hours/days, ssd disk are recommended to accelerate nominatim queries.
@@ -65,7 +70,7 @@ The import of worldwide data set will take some hours/days, ssd disk are recomme
6570
In order to update from nominatim, you must start photon with the nominatim database credentials on the command line:
6671

6772
```bash
68-
java -jar photon-0.2.7.jar -host localhost -port 5432 -database nominatim -user nominatim -password ...
73+
java -jar photon-*.jar -host localhost -port 5432 -database nominatim -user nominatim -password ...
6974
```
7075

7176
A nominatim setup is also a requirement to have continuous updates. To keep in sync with the latest OSM changes run:
@@ -83,10 +88,6 @@ curl http://localhost:2322/nominatim-update
8388

8489

8590
### Search API
86-
#### Start Photon
87-
```bash
88-
java -jar photon-0.2.7.jar
89-
```
9091

9192
#### Search
9293
```

pom.xml

+5-32
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
<dependency>
8484
<groupId>org.projectlombok</groupId>
8585
<artifactId>lombok</artifactId>
86-
<version>1.12.6</version>
86+
<version>1.16.18</version>
8787
<scope>provided</scope>
8888
</dependency>
8989
<dependency>
@@ -126,40 +126,10 @@
126126
<dependency>
127127
<groupId>org.mockito</groupId>
128128
<artifactId>mockito-core</artifactId>
129-
<version>1.10.19</version>
129+
<version>2.13.0</version>
130130
<scope>test</scope>
131131
</dependency>
132132

133-
<dependency>
134-
<groupId>org.powermock</groupId>
135-
<artifactId>powermock-module-junit4</artifactId>
136-
<version>1.6.4</version>
137-
<scope>test</scope>
138-
<exclusions>
139-
<exclusion>
140-
<groupId>org.hamcrest</groupId>
141-
<artifactId>hamcrest-core</artifactId>
142-
</exclusion>
143-
</exclusions>
144-
</dependency>
145-
146-
<dependency>
147-
<groupId>org.powermock</groupId>
148-
<artifactId>powermock-api-mockito</artifactId>
149-
<version>1.6.4</version>
150-
<scope>test</scope>
151-
<exclusions>
152-
<exclusion>
153-
<groupId>org.mockito</groupId>
154-
<artifactId>mockito-core</artifactId>
155-
</exclusion>
156-
<exclusion>
157-
<groupId>org.hamcrest</groupId>
158-
<artifactId>hamcrest-core</artifactId>
159-
</exclusion>
160-
</exclusions>
161-
</dependency>
162-
163133
<dependency>
164134
<groupId>com.google.guava</groupId>
165135
<artifactId>guava</artifactId>
@@ -253,6 +223,9 @@
253223
<resource>
254224
<directory>es/</directory>
255225
</resource>
226+
<resource>
227+
<directory>src/main/resources/</directory>
228+
</resource>
256229
</resources>
257230
</build>
258231
<properties>

0 commit comments

Comments
 (0)