001/* 002 * Licensed to the Apache Software Foundation (ASF) under one 003 * or more contributor license agreements. See the NOTICE file 004 * distributed with this work for additional information 005 * regarding copyright ownership. The ASF licenses this file 006 * to you under the Apache License, Version 2.0 (the 007 * "License"); you may not use this file except in compliance 008 * with the License. You may obtain a copy of the License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, 013 * software distributed under the License is distributed on an 014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 015 * KIND, either express or implied. See the License for the 016 * specific language governing permissions and limitations 017 * under the License. 018 * 019 */ 020 021package org.apache.directory.server.dns.io.encoder; 022 023 024/** 025 * 2. RDATA Format 026 * 027 * MSB LSB 028 * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 029 * 0| VERSION | SIZE | 030 * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 031 * 2| HORIZ PRE | VERT PRE | 032 * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 033 * 4| LATITUDE | 034 * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 035 * 6| LATITUDE | 036 * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 037 * 8| LONGITUDE | 038 * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 039 * 10| LONGITUDE | 040 * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 041 * 12| ALTITUDE | 042 * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 043 * 14| ALTITUDE | 044 * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 045 * (octet) 046 * 047 * where: 048 * 049 * VERSION Version number of the representation. This must be zero. 050 * Implementations are required to check this field and make 051 * no assumptions about the format of unrecognized versions. 052 * 053 * SIZE The diameter of a sphere enclosing the described entity, in 054 * centimeters, expressed as a pair of four-bit unsigned 055 * integers, each ranging from zero to nine, with the most 056 * significant four bits representing the base and the second 057 * number representing the power of ten by which to multiply 058 * the base. This allows sizes from 0e0 (<1cm) to 9e9 059 * (90,000km) to be expressed. This representation was chosen 060 * such that the hexadecimal representation can be read by 061 * eye; 0x15 = 1e5. Four-bit values greater than 9 are 062 * undefined, as are values with a base of zero and a non-zero 063 * exponent. 064 * 065 * Since 20000000m (represented by the value 0x29) is greater 066 * than the equatorial diameter of the WGS 84 ellipsoid 067 * (12756274m), it is therefore suitable for use as a 068 * "worldwide" size. 069 * 070 * HORIZ PRE The horizontal precision of the data, in centimeters, 071 * expressed using the same representation as SIZE. This is 072 * the diameter of the horizontal "circle of error", rather 073 * than a "plus or minus" value. (This was chosen to match 074 * the interpretation of SIZE; to get a "plus or minus" value, 075 * divide by 2.) 076 * 077 * VERT PRE The vertical precision of the data, in centimeters, 078 * expressed using the sane representation as for SIZE. This 079 * is the total potential vertical error, rather than a "plus 080 * or minus" value. (This was chosen to match the 081 * interpretation of SIZE; to get a "plus or minus" value, 082 * divide by 2.) Note that if altitude above or below sea 083 * level is used as an approximation for altitude relative to 084 * the [WGS 84] ellipsoid, the precision value should be 085 * adjusted. 086 * 087 * LATITUDE The latitude of the center of the sphere described by the 088 * SIZE field, expressed as a 32-bit integer, most significant 089 * octet first (network standard byte order), in thousandths 090 * of a second of arc. 2^31 represents the equator; numbers 091 * above that are north latitude. 092 * 093 * LONGITUDE The longitude of the center of the sphere described by the 094 * SIZE field, expressed as a 32-bit integer, most significant 095 * octet first (network standard byte order), in thousandths 096 * of a second of arc, rounded away from the prime meridian. 097 * 2^31 represents the prime meridian; numbers above that are 098 * east longitude. 099 * 100 * ALTITUDE The altitude of the center of the sphere described by the 101 * SIZE field, expressed as a 32-bit integer, most significant 102 * octet first (network standard byte order), in centimeters, 103 * from a base of 100,000m below the [WGS 84] reference 104 * spheroid used by GPS (semimajor axis a=6378137.0, 105 * reciprocal flattening rf=298.257223563). Altitude above 106 * (or below) sea level may be used as an approximation of 107 * altitude relative to the the [WGS 84] spheroid, though due 108 * to the Earth's surface not being a perfect spheroid, there 109 * will be differences. (For example, the geoid (which sea 110 * level approximates) for the continental US ranges from 10 111 * meters to 50 meters below the [WGS 84] spheroid. 112 * Adjustments to ALTITUDE and/or VERT PRE will be necessary 113 * in most cases. The Defense Mapping Agency publishes geoid 114 * height values relative to the [WGS 84] ellipsoid. 115 * 116 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a> 117 */ 118public class LocationRecordEncoder 119{ 120}