All Downloads are FREE. Search and download functionalities are using the official Maven repository.

px.3.2.0.source-code.module-info Maven / Gradle / Ivy

There is a newer version: 3.2.1
Show newest version
/*
 * Java GPX Library (jpx-3.2.0).
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * JPX is a library for creating, reading and writing
 * GPS
 * data in GPX
 * format. It is a full implementation of version
 * 1.1 and version
 * 1.0 of the GPX format.
 * The data classes are completely immutable and allow a functional programming
 * style. It is also possible to convert the location information into strings
 * which are compatible to the 
 * ISO 6709 standard.
 *
 * 

* Examples: *

* Creating a GPX object with one track-segment and 3 track-points *

{@code
 * final GPX gpx = GPX.builder()
 *     .addTrack(track -> track
 *         .addSegment(segment -> segment
 *             .addPoint(p -> p.lat(48.20100).lon(16.31651).ele(283))
 *             .addPoint(p -> p.lat(48.20112).lon(16.31639).ele(278))
 *             .addPoint(p -> p.lat(48.20126).lon(16.31601).ele(274))))
 *     .build();
 * }
* * Writing a GPX file *
{@code
 * final var indent = new GPX.Writer.Indent("    ");
 * GPX.Writer.of(indent).write(gpx, Path.of("points.gpx"));
 * }
* * This will produce the following output. *
{@code
 * 
 *     
 *         
 *             
 *                 283
 *             
 *             
 *                 278
 *             
 *             
 *                 274
 *             
 *         
 *     
 * 
 * }
* * Reading a GPX file *
{@code
 * final GPX gpx = GPX.read(Path.of("points.gpx"));
 * }
* * Reading erroneous GPX files *
{@code
 * final GPX gpx = GPX.Reader
 *     .of(GPX.Reader.Mode.LENIENT)
 *     .read(Path.of("points.gpx"));
 * }
* * This allows reading otherwise invalid GPX files, like *
{@code
 * 
 * 
 *   
 *     
 *     
 *   
 *   
 *     
 *       
 *         0.000
 *         
 *         43.5
 *         2d
 *         3
 *         4.200000
 *         1.000000
 *         4.300000
 *       
 *       
 *         0.000
 *         
 *         43.5
 *         2d
 *         3
 *         16.600000
 *         0.900000
 *         16.600000
 *       
 *     
 *   
 * 
 * }
* * which is read as (if you write it again) *
{@code
 * 
 * 
 *     
 *         
 *         
 *     
 *     
 *         
 *             
 *                 0
 *                 
 *                 43.5
 *                 2d
 *                 3
 *                 4.2
 *                 1
 *                 4.3
 *             
 *             
 *                 0
 *                 
 *                 43.5
 *                 2d
 *                 3
 *                 16.6
 *                 0.9
 *                 16.6
 *             
 *         
 *     
 * 
 * }
* * Converting a GPX object to an XML {@link org.w3c.dom.Document} *
{@code
 * 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));
 * }
*/ module io.jenetics.jpx { requires transitive java.xml; exports io.jenetics.jpx; exports io.jenetics.jpx.format; exports io.jenetics.jpx.geom; uses io.jenetics.jpx.XMLProvider; }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy