### Build Project with Maven Source: https://github.com/tomtom-international/openlr/blob/master/README.md Instructions for building the OpenLR project using Maven. This command cleans the project and installs all modules. It can be run from the project root or individual module folders. ```maven mvn clean install ``` -------------------------------- ### OpenLR Point Along Line Location Reference (XML) Source: https://github.com/tomtom-international/openlr/blob/master/datex2/src/test/resources/pointalong.txt This XML snippet demonstrates an OpenLR point along a line location reference. It includes details such as side of road, orientation, positive offset, location reference points with coordinates, and line/path attributes. ```XML left noOrientationOrUnknown 28 49.60597 6.12829 FRC2 multipleCarriageway 202 FRC2 92 49.60521 6.12779 FRC2 multipleCarriageway 42 ``` -------------------------------- ### OpenLR Location Data Structure (XML) Source: https://github.com/tomtom-international/openlr/blob/master/datex2/src/test/resources/geocoord.txt This snippet shows an XML structure for representing OpenLR location data within a DATE2 SituationPublication. It details the hierarchical structure for point locations and includes specific latitude and longitude coordinates. ```xml 49.60728 6.12699 ``` -------------------------------- ### Running OpenLR Sample Tests Source: https://github.com/tomtom-international/openlr/blob/master/openlr-usage-sample/README.md Command to compile and run the unit tests for the OpenLR sample project using Maven. This verifies the integration and functionality of the encoder and decoder with a sample map. ```shell mvn test ``` -------------------------------- ### OpenLR Maven Dependencies Source: https://github.com/tomtom-international/openlr/blob/master/openlr-usage-sample/README.md Dependencies required to include the OpenLR reference implementation in a Java project. These artifacts provide the core encoder, decoder, and binary format functionalities. ```xml org.openlr encoder 1.4.3 org.openlr decoder 1.4.3 org.openlr binary 1.4.3 ``` -------------------------------- ### Load Map Database from SQLite Source: https://github.com/tomtom-international/openlr/blob/master/HOWTO.md Demonstrates loading map data into an OpenLR MapDatabase instance using a SQLite loader. It specifies the map file path via DBFileNameParameter and initializes the loader. ```java MapLoadParameter param = new DBFileNameParameter(); param.setValue("path/to/map"); OpenLRMapLoader loader = new SQLiteMapLoader(); MapDatabase map = loader.load(Arrays.asList(param)); ``` -------------------------------- ### Maven Dependencies for OpenLR Modules Source: https://github.com/tomtom-international/openlr/blob/master/HOWTO.md Essential Maven dependencies required to use various modules of the OpenLR library, including encoder, decoder, map data handling, and different physical format support (binary, protobuf, XML). Replace ${openlr.version} with the desired library version. ```xml org.openlr encoder ${openlr.version} ``` ```xml org.openlr decoder ${openlr.version} ``` ```xml org.openlr map ${openlr.version} ``` ```xml org.openlr data ${openlr.version} ``` ```xml org.openlr binary ${openlr.version} ``` ```xml org.openlr xml ${openlr.version} ``` ```xml org.openlr proto ${openlr.version} ``` -------------------------------- ### Decode OpenLR Binary Location Reference in Java Source: https://github.com/tomtom-international/openlr/blob/master/HOWTO.md Demonstrates decoding an OpenLR binary location reference string in Java. It initializes the decoder, loads properties, and decodes a Base64 encoded binary string into a map-locatable format. Requires OpenLR libraries and a properties file. ```java String openlr = "CwmQ9SVWJS2qBAD9/14tCQ=="; OpenLRBinaryDecoder binaryDecoder = new OpenLRBinaryDecoder(); ByteArray byteArray = new ByteArray(Base64.getDecoder().decode(openlr)); LocationReferenceBinaryImpl locationReferenceBinary = new LocationReferenceBinaryImpl("Test location", byteArray); RawLocationReference rawLocationReference = binaryDecoder.decodeData(locationReferenceBinary); Configuration decoderConfig = OpenLRPropertiesReader.loadPropertiesFromFile(new File(TestMapStubTest.class.getClassLoader().getResource("OpenLR-Decoder-Properties.xml").getFile())); OpenLRDecoderParameter params = new OpenLRDecoderParameter.Builder().with(map).with(decoderConfig).buildParameter(); OpenLRDecoder decoder = new openlr.decoder.OpenLRDecoder(); Location location = decoder.decodeRaw(params, rawLocationReference); ``` -------------------------------- ### Encode Line Location to OpenLR Binary Format Source: https://github.com/tomtom-international/openlr/blob/master/HOWTO.md Shows how to encode a line location, represented by a list of map lines, into the OpenLR binary format. It involves creating a LineLocation, initializing a binary encoder, configuring encoder properties, and generating the final binary data. ```java //Build the line location List testLocation = Arrays.asList(mapDatabaseAdapter.getLine(1), mapDatabaseAdapter.getLine(2), mapDatabaseAdapter.getLine(3), mapDatabaseAdapter.getLine(4)); Location location = LocationFactory.createLineLocation("Test location", testLocation, 0, 0); //Initialize the physical format encoder PhysicalEncoder physicalEncoder = new OpenLRBinaryEncoder(); //Build the encoder configurations Configuration encoderConfig = OpenLRPropertiesReader.loadPropertiesFromFile(new File("OpenLR-Encoder-Properties.xml")); OpenLREncoderParameter params = new OpenLREncoderParameter.Builder().with(map).with(encoderConfig) .with(Arrays.asList(physicalEncoder)) .buildParameter(); //Initialize the onpenlr encoder OpenLREncoder encoder = new openlr.encoder.OpenLREncoder(); //Encode the line location in openlr format LocationReferenceHolder locationReferenceHolder = encoder.encodeLocation(params, location); //Generate the binary for the openlr location referencing container String locationReferenceBinary = ((ByteArray) physicalEncoder.encodeData(locationReferenceHolder.getRawLocationReferenceData()).getLocationReferenceData()).getBase64Data(); ``` -------------------------------- ### OpenLR Linear Location Reference Structure Source: https://github.com/tomtom-international/openlr/blob/master/datex2/src/test/resources/line.txt This snippet represents a DATE2 SituationPublication containing an OpenLR linear location reference. It defines a sequence of location reference points, each with coordinates, functional road class, form of way, bearing, and distance to the next point. It also includes offsets for precise location within the line segment. ```XML 49.60851 6.12683 FRC3 multipleCarriageway 135 FRC3 561 49.60398 6.12838 FRC3 singleCarriageway 227 FRC5 274 49.60305 6.12817 FRC5 singleCarriageway 290 200 0 ``` -------------------------------- ### DATECT 2.0 Situation Publication (Accident) Source: https://github.com/tomtom-international/openlr/blob/master/datex2/src/test/resources/poiaccess.txt The overall structure of a DATECT 2.0 Situation Publication, specifically detailing an accident. It includes a group of locations which, in this case, uses OpenLR for point-based location referencing. ```XML left noOrientationOrUnknown 28 49.60597 6.12829 FRC2 multipleCarriageway 202 FRC2 92 49.60521 6.12779 FRC2 multipleCarriageway 42 49.60728 6.12699 ``` -------------------------------- ### OpenLR Poi With Access Point Source: https://github.com/tomtom-international/openlr/blob/master/datex2/src/test/resources/poiaccess.txt Represents a Point of Interest (POI) with an access point, including side of road, orientation, positive offset, and the location reference point. This structure is used to pinpoint specific locations along a road. ```XML left noOrientationOrUnknown 28 49.60597 6.12829 FRC2 multipleCarriageway 202 FRC2 92 49.60521 6.12779 FRC2 multipleCarriageway 42 49.60728 6.12699 ``` -------------------------------- ### OpenLR Location Reference Point Source: https://github.com/tomtom-international/openlr/blob/master/datex2/src/test/resources/poiaccess.txt Details the structure for an OpenLR location reference point, including coordinates, line attributes, and path attributes. This is crucial for defining segments of a road network. ```XML 49.60597 6.12829 FRC2 multipleCarriageway 202 FRC2 92 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.