Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 25 additions & 24 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
name: JPX Build

on:
push:
branches:
- master
- releases/*
- issues/*
pull_request:
branches:
- master
- releases/*
push:
branches:
- master
- releases/*
- issues/*
pull_request:
branches:
- master
- releases/*

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, macos-latest ]
java-version: [ 21, 24 ]
steps:
- uses: actions/checkout@v2
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, macos-latest ]
java-version: [ 25 ]
steps:
- uses: actions/checkout@v4

- name: Set up JDK ${{ matrix.java-version }} on ${{ matrix.os }}
uses: actions/setup-java@v2
with:
java-version: ${{ matrix.java-version }}
distribution: 'zulu'
- name: Build with Gradle
run: ./gradlew build --stacktrace --info
- name: Set up JDK ${{ matrix.java-version }} on ${{ matrix.os }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java-version }}
distribution: 'zulu'
cache: 'gradle'
- name: Build with Gradle
run: ./gradlew build --stacktrace --info
54 changes: 6 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
# JPX

![Build Status](https://github.com/jenetics/jpx/actions/workflows/gradle.yml/badge.svg)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.jenetics/jpx/badge.svg)](http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22jpx%22)
[![Maven Central Version](https://img.shields.io/maven-central/v/io.jenetics/jpx?color=green)](https://central.sonatype.com/artifact/io.jenetics/jpx)
[![Javadoc](https://www.javadoc.io/badge/io.jenetics/jpx.svg)](http://www.javadoc.io/doc/io.jenetics/jpx)

**JPX** is a Java library for creating, reading and writing [GPS](https://en.wikipedia.org/wiki/Global_Positioning_System) data in [GPX](https://en.wikipedia.org/wiki/GPS_Exchange_Format) format. It is a *full* implementation of version [1.1](http://www.topografix.com/GPX/1/1/) and version [1.0](http://www.topografix.com/gpx_manual.asp) of the GPX format. The data classes are completely immutable and allows a functional programming style. They are working also nicely with the Java [Stream](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/stream/Stream.html) API. It is also possible to convert the location information into strings which are compatible to the [ISO 6709](http://en.wikipedia.org/wiki/ISO_6709) standard.

**JPX** is a Java library for creating, reading and writing [GPS](https://en.wikipedia.org/wiki/Global_Positioning_System) data in [GPX](https://en.wikipedia.org/wiki/GPS_Exchange_Format) format. It is a *full* implementation of version [1.1](http://www.topografix.com/GPX/1/1/) and version [1.0](http://www.topografix.com/gpx_manual.asp) of the GPX format. The data classes are completely immutable and allows a functional programming style. They are working also nicely with the Java [Stream](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/stream/Stream.html) API. It is also possible to convert the location information into strings which are compatible to the [ISO 6709](http://en.wikipedia.org/wiki/ISO_6709) standard.

Besides the basic functionality of reading and writing GPX files, the library also allows manipulating the read GPX object in a functional way.


## Dependencies

The _JPX_ library needs no external dependencies. It only needs **Java 17** to compile and run. It also runs and compiles with **Java 21** and **Java 23**.
The _JPX_ library needs no external dependencies. It needs **Java 25** to compile and run.


## Building JPX
Expand Down Expand Up @@ -314,7 +315,7 @@ org.acme.NonValidatingDocumentBuilder

The library is licensed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html).

Copyright 2016-2025 Franz Wilhelmstötter
Copyright 2016-2026 Franz Wilhelmstötter

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -330,7 +331,7 @@ The library is licensed under the [Apache License, Version 2.0](http://www.apach

## Release notes

### [3.2.1](https://github.com/jenetics/jpx/releases/tag/v3.2.1)
### [4.0.0](https://github.com/jenetics/jpx/releases/tag/v4.0.0)

#### Improvements

Expand All @@ -345,47 +346,4 @@ The library is licensed under the [Apache License, Version 2.0](http://www.apach

### [3.1.0](https://github.com/jenetics/jpx/releases/tag/v3.1.0)

#### Improvements

* [#170](https://github.com/jenetics/jpx/issues/170): GPX files with invalid version number are now readable in _LENIENT_ mode.
```java
final GPX gpx;
try (InputStream in = new FileInputStream(resource)) {
gpx = GPX.Reader.of(Mode.LENIENT).read(in);
}
```

#### Bugs

* [#167](https://github.com/jenetics/jpx/issues/167): Fixing a test case for Windows.

### [3.0.1](https://github.com/jenetics/jpx/releases/tag/v3.0.1)

#### Bugs

* [#162](https://github.com/jenetics/jpx/issues/162): Elevation serialization for values > 1000m is incompatible with deserialization.

### [3.0.0](https://github.com/jenetics/jpx/releases/tag/v3.0.0)

#### Improvements

* [#125](https://github.com/jenetics/jpx/issues/125): **Breaking change** - Use `Instant` instead of `ZonedDateTime` for `Point.time` property.
* [#148](https://github.com/jenetics/jpx/issues/148): **Breaking change** - Update to Java17.
* [#155](https://github.com/jenetics/jpx/issues/155): Improved `GPX.Reader` and `GPX.Writer` classes.
* [#158](https://github.com/jenetics/jpx/issues/158): Add XML `Document` reader/writer methods.
```java
final GPX gpx = ...;

final Document doc = XMLProvider.provider()
.documentBuilderFactory()
.newDocumentBuilder()
.newDocument();

// The GPX data are written to the empty `doc` object.
GPX.Writer.DEFAULT.write(gpx, new DOMResult(doc));
```

#### Bugs

* [#151](https://github.com/jenetics/jpx/issues/151): `Double`'s being written as exponents in GPX file.
* [#152](https://github.com/jenetics/jpx/issues/152): `LocationFormatter::parse` method is not thread-safe.
10 changes: 5 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ plugins {
rootProject.version = JPX.VERSION

tasks.named<Wrapper>("wrapper") {
version = "9.0.0"
version = "9.3.1"
distributionType = Wrapper.DistributionType.ALL
}

Expand Down Expand Up @@ -72,8 +72,8 @@ gradle.projectsEvaluated {

plugins.withType<JavaPlugin> {
configure<JavaPluginExtension> {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
sourceCompatibility = JavaVersion.VERSION_25
targetCompatibility = JavaVersion.VERSION_25
}

configure<JavaPluginExtension> {
Expand Down Expand Up @@ -133,7 +133,7 @@ fun setupTestReporting(project: Project) {
project.apply(plugin = "jacoco")

project.configure<JacocoPluginExtension> {
toolVersion = "0.8.12"
toolVersion = libs.jacoco.agent.get().version.toString()
}

project.tasks {
Expand Down Expand Up @@ -170,7 +170,7 @@ fun setupJavadoc(project: Project) {
doclet.charSet = "UTF-8"
doclet.linkSource(true)
doclet.linksOffline(
"https://docs.oracle.com/en/java/javase/21/docs/api/",
"https://docs.oracle.com/en/java/javase/25/docs/api/",
"${project.rootDir}/buildSrc/resources/javadoc/java.se"
)
doclet.windowTitle = "JPX ${project.version}"
Expand Down
9 changes: 7 additions & 2 deletions buildSrc/resources/javadoc/java.se/element-list
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ module:java.base
java.io
java.lang
java.lang.annotation
java.lang.classfile
java.lang.classfile.attribute
java.lang.classfile.constantpool
java.lang.classfile.instruction
java.lang.constant
java.lang.foreign
java.lang.invoke
Expand Down Expand Up @@ -91,6 +95,7 @@ javax.print
javax.print.attribute
javax.print.attribute.standard
javax.print.event
javax.sound
javax.sound.midi
javax.sound.midi.spi
javax.sound.sampled
Expand Down Expand Up @@ -210,7 +215,6 @@ com.sun.source.tree
com.sun.source.util
com.sun.tools.javac
module:jdk.crypto.cryptoki
module:jdk.crypto.ec
module:jdk.dynalink
jdk.dynalink
jdk.dynalink.beans
Expand Down Expand Up @@ -255,6 +259,7 @@ module:jdk.jstatd
module:jdk.localedata
module:jdk.management
com.sun.management
jdk.management
module:jdk.management.agent
module:jdk.management.jfr
jdk.management.jfr
Expand All @@ -279,4 +284,4 @@ org.w3c.dom.css
org.w3c.dom.html
org.w3c.dom.stylesheets
org.w3c.dom.xpath
module:jdk.zipfs
module:jdk.zipfs
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/Env.kt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ object Env {
* Information about the library and author.
*/
object JPX {
const val VERSION = "4.0.0-SNAPSHOT"
const val VERSION = "4.0.0"
const val ID = "jpx"
const val NAME = "jpx"
const val GROUP = "io.jenetics"
Expand Down
40 changes: 20 additions & 20 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[versions]
assertj = "3.27.4"
codemodel = "4.0.5"
assertj = "3.27.7"
codemodel = "4.0.6"
commons-csv = "1.14.1"
commons-math4-legacy = "4.0-beta1"
commons-numbers-combinatorics = "1.2"
Expand All @@ -9,35 +9,35 @@ commons-numbers-gamma = "1.2"
commons-numbers-rootfinder = "1.2"
commons-rng-sampling = "1.6"
commons-rng-simple = "1.6"
commons-statistics-descriptive = "1.1"
commons-statistics-distribution = "1.1"
equalsverifier = "4.0.9"
commons-statistics-descriptive = "1.2"
commons-statistics-distribution = "1.2"
equalsverifier = "4.4"
facilejdbc = "2.1.1"
guava = "33.4.8-jre"
h2 = "2.3.232"
jackson = "2.19.2"
jackson-databind-nullable = "0.2.7"
jackson-datatype-jsr310 = "2.19.2"
jacoco-agent = "0.8.13"
guava = "33.5.0-jre"
h2 = "2.4.240"
jackson = "2.21"
jackson-databind-nullable = "0.2.9"
jackson-datatype-jsr310 = "2.21.0"
jacoco-agent = "0.8.14"
jakarta-annotation-api = "3.0.0"
jakarta-validation-api = "3.1.1"
javacsv = "2.0"
jexl = "3.5.0"
jexl = "3.6.2"
jmh = "0.7.3"
jpx = "3.2.1"
lombok = "8.14.2"
lombok = "9.2.0"
mvel = "2.5.2.Final"
nashorn = "15.7"
openapi-generator = "7.14.0"
openapi-generator = "7.20.0"
opencsv = "5.12.0"
prngine = "2.0.0"
reactor-core = "3.7.9"
reactor-core = "3.8.3"
rxjava = "2.2.21"
supercsv = "2.4.0"
swagger-models = "2.2.36"
swagger-parser = "2.1.32"
testng = "7.11.0"
version-catalog-update = "1.0.0"
swagger-models = "2.2.43"
swagger-parser = "2.1.38"
testng = "7.12.0"
version-catalog-update = "1.1.0"

[plugins]
jmh = { id = "me.champeau.jmh", version.ref = "jmh" }
Expand All @@ -63,7 +63,7 @@ facilejdbc = { module = "io.jenetics:facilejdbc", version.ref = "facilejdbc" }
guava = { module = "com.google.guava:guava", version.ref = "guava" }
h2 = { module = "com.h2database:h2", version.ref = "h2" }
jackson-annotations = { module = "com.fasterxml.jackson.core:jackson-annotations", version.ref = "jackson" }
jackson-databind = { module = "com.fasterxml.jackson.core:jackson-databind", version.ref = "jackson" }
jackson-databind = "com.fasterxml.jackson.core:jackson-databind:2.21.0"
jackson-databind-nullable = { module = "org.openapitools:jackson-databind-nullable", version.ref = "jackson-databind-nullable" }
jackson-datatype-jsr310 = { module = "com.fasterxml.jackson.datatype:jackson-datatype-jsr310", version.ref = "jackson-datatype-jsr310" }
jacoco-agent = { module = "org.jacoco:org.jacoco.agent", version.ref = "jacoco-agent" }
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
11 changes: 5 additions & 6 deletions gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions jpx/src/main/java/io/jenetics/jpx/Bounds.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ public int hashCode() {

@Override
public boolean equals(final Object obj) {
return obj == this ||
obj instanceof Bounds bounds &&
return obj instanceof Bounds bounds &&
Objects.equals(bounds._minLatitude, _minLatitude) &&
Objects.equals(bounds._minLongitude, _minLongitude) &&
Objects.equals(bounds._maxLatitude, _maxLatitude) &&
Expand All @@ -140,7 +139,6 @@ public String toString() {
* Return a collector which calculates the bounds of a given way-point
* stream. The following example shows how to calculate the bounds of all
* track-points of a given GPX object.
*
* {@snippet lang="java":
* final Bounds bounds = gpx.tracks()
* .flatMap(Track::segments)
Expand Down
3 changes: 1 addition & 2 deletions jpx/src/main/java/io/jenetics/jpx/Copyright.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ public int hashCode() {

@Override
public boolean equals(final Object obj) {
return obj == this ||
obj instanceof Copyright cr &&
return obj instanceof Copyright cr &&
Objects.equals(cr._author, _author) &&
Objects.equals(cr._year, _year) &&
Objects.equals(cr._license, _license);
Expand Down
Loading