Tabnine Logo
WKTUtilities.suggestFractionDigits
Code IndexAdd Tabnine to your IDE (free)

How to use
suggestFractionDigits
method
in
org.apache.sis.internal.referencing.WKTUtilities

Best Java code snippets using org.apache.sis.internal.referencing.WKTUtilities.suggestFractionDigits (Showing top 3 results out of 315)

origin: apache/sis

/**
 * Formats this position in the <cite>Well Known Text</cite> (WKT) format.
 * The format is like below, where {@code x₀}, {@code x₁}, {@code x₂}, <i>etc.</i>
 * are the ordinate values at index 0, 1, 2, <i>etc.</i>:
 *
 * {@preformat wkt
 *   POINT[x₀ x₁ x₂ …]
 * }
 *
 * If the coordinate reference system is geodetic or projected, then coordinate values are formatted
 * with a precision equivalent to one centimetre on Earth (the actual number of fraction digits is
 * adjusted for the axis unit of measurement and the planet size if different than Earth).
 *
 * @param  formatter  the formatter where to format the inner content of this point.
 * @return the WKT keyword, which is {@code "Point"} for this element.
 *
 * @since 1.0
 */
@Override
protected String formatTo(final Formatter formatter) {
  final double[][] points = new double[][] {getCoordinate()};
  formatter.append(points, WKTUtilities.suggestFractionDigits(getCoordinateReferenceSystem(), points));
  return WKTKeywords.Point;
}
origin: apache/sis

  getUpperCorner().getCoordinate()
};
formatter.append(points, WKTUtilities.suggestFractionDigits(getCoordinateReferenceSystem(), points));
final int dimension = getDimension();
String keyword = "Box";
origin: apache/sis

  /**
   * Tests {@link WKTUtilities#suggestFractionDigits(CoordinateReferenceSystem, double[]...)}.
   */
  @Test
  public void testSuggestFractionDigits() {
    assertArrayEquals(new int[] {8, 9}, WKTUtilities.suggestFractionDigits(HardCodedCRS.WGS84, new double[][] {
      {40, -10},
      {50, -10.000000001}
    }));
  }
}
org.apache.sis.internal.referencingWKTUtilitiessuggestFractionDigits

Javadoc

Suggests an amount of fraction digits to use for formatting numbers in each column of the given sequence of points. The number of fraction digits may be negative if we could round the numbers to 10, etc.

Popular methods of WKTUtilities

  • appendName
    Appends the name of the given object to the formatter.
  • appendParamMT
    Appends a ParameterValueGroup in a Param_MT[…] element.
  • toType
    Returns the WKT type of the given interface. For CoordinateSystem base type, the returned value shal
  • append
    Appends a ParameterValue in a PARAMETER[…] element. If the supplied parameter is actually a Paramete
  • isEPSG
    Returns true if the given parameter is defined in the EPSG code space. We handle EPSG parameters in
  • toFormattable
    Returns the given prime meridian as a formattable object.

Popular in Java

  • Finding current android device location
  • scheduleAtFixedRate (ScheduledExecutorService)
  • setContentView (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now