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

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

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

origin: org.apache.sis.core/sis-referencing

/**
 * Appends a {@linkplain ParameterValueGroup group of parameters} in a {@code Param_MT[…]} element.
 *
 * @param  parameters  the parameter to append to the WKT, or {@code null} if none.
 * @param  formatter   the formatter where to append the parameter.
 */
public static void appendParamMT(final ParameterValueGroup parameters, final Formatter formatter) {
  if (parameters != null) {
    appendName(parameters.getDescriptor(), formatter, ElementKind.PARAMETER);
    append(parameters, formatter);
  }
}
origin: org.apache.sis.core/sis-referencing

  /**
   * Formats this group as a pseudo-<cite>Well Known Text</cite> element.
   *
   * @param  formatter  the formatter where to format the inner content of this WKT element.
   * @return {@code "ParameterGroup"}.
   */
  @Override
  protected String formatTo(final Formatter formatter) {
    WKTUtilities.appendParamMT(this, formatter);
    return WKTKeywords.ParameterGroup;
  }
}
origin: org.apache.sis.core/sis-referencing

  @Override protected String formatTo(final Formatter formatter) {
    formatter.indent(-1);
    formatter.append(WKTUtilities.toFormattable(crs));
    formatter.indent(+1);
    return type;
  }
});
origin: apache/sis

WKTUtilities.appendName(this, formatter, null);
final Convention convention = formatter.getConvention();
final List<? extends CoordinateReferenceSystem> crs;
  formatter.append(WKTUtilities.toFormattable(element));
origin: org.apache.sis.core/sis-referencing

/** Formats this {@code Conversion} element. */
@Override protected String formatTo(final Formatter formatter) {
  WKTUtilities.appendName(conversion, formatter, null);
  formatter.newLine();
  append(formatter);
  return WKTKeywords.Conversion;
}
origin: apache/sis

  /**
   * Tests {@link WKTUtilities#toType(Class, Class)}.
   *
   * @see ReferencingUtilitiesTest#testToPropertyName()
   */
  @Test
  public void testToType() {
    assertNull  (                         toType(CoordinateSystem.class, CoordinateSystem.class));
    assertEquals(WKTKeywords.affine,      toType(CoordinateSystem.class, AffineCS        .class));
    assertEquals(WKTKeywords.Cartesian,   toType(CoordinateSystem.class, CartesianCS     .class));
    assertEquals(WKTKeywords.cylindrical, toType(CoordinateSystem.class, CylindricalCS   .class));
    assertEquals(WKTKeywords.ellipsoidal, toType(CoordinateSystem.class, EllipsoidalCS   .class));
    assertEquals(WKTKeywords.linear,      toType(CoordinateSystem.class, LinearCS        .class));
//      assertEquals(WKTKeywords.parametric,  toType(CoordinateSystem.class, ParametricCS    .class));
    assertEquals(WKTKeywords.polar,       toType(CoordinateSystem.class, PolarCS         .class));
    assertEquals(WKTKeywords.spherical,   toType(CoordinateSystem.class, SphericalCS     .class));
    assertEquals(WKTKeywords.temporal,    toType(CoordinateSystem.class, TimeCS          .class));
    assertEquals(WKTKeywords.vertical,    toType(CoordinateSystem.class, VerticalCS      .class));
  }

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

final boolean filter = WKTUtilities.isEPSG(parameters.getDescriptor(), false) &&   // NOT method.getName()
    Constants.EPSG.equalsIgnoreCase(Citations.toCodeSpace(formatter.getNameAuthority()));
formatter.newLine();
formatter.indent(+1);
for (final GeneralParameterValue param : parameters.values()) {
  if (!filter || WKTUtilities.isEPSG(param.getDescriptor(), true)) {
    WKTUtilities.append(param, formatter);
origin: org.apache.sis.core/sis-referencing

/**
 * Appends a {@linkplain ParameterValue parameter} in a {@code PARAMETER[…]} element.
 * If the supplied parameter is actually a {@linkplain ParameterValueGroup parameter group},
 * all contained parameters will be flattened in a single list.
 *
 * @param  parameter  the parameter to append to the WKT, or {@code null} if none.
 * @param  formatter  the formatter where to append the parameter.
 */
public static void append(GeneralParameterValue parameter, final Formatter formatter) {
  if (parameter instanceof ParameterValueGroup) {
    boolean first = true;
    for (final GeneralParameterValue param : ((ParameterValueGroup) parameter).values()) {
      if (first) {
        formatter.newLine();
        first = false;
      }
      append(param, formatter);
    }
  }
  if (parameter instanceof ParameterValue<?>) {
    if (!(parameter instanceof FormattableObject)) {
      parameter = new DefaultParameterValue<>((ParameterValue<?>) parameter);
    }
    formatter.append((FormattableObject) parameter);
    formatter.newLine();
  }
}
origin: org.apache.sis.core/sis-referencing

WKTUtilities.appendName(this, formatter, null);
final Convention convention = formatter.getConvention();
final List<? extends CoordinateReferenceSystem> crs;
  formatter.append(WKTUtilities.toFormattable(element));
origin: apache/sis

/** Formats this {@code Conversion} element. */
@Override protected String formatTo(final Formatter formatter) {
  WKTUtilities.appendName(conversion, formatter, null);
  formatter.newLine();
  append(formatter);
  return WKTKeywords.Conversion;
}
origin: apache/sis

final String type = WKTUtilities.toType(CoordinateSystem.class, getInterface());
if (type == null) {
  formatter.setInvalidWKT(this, null);
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}
    }));
  }
}
origin: org.apache.sis.core/sis-referencing

final boolean filter = WKTUtilities.isEPSG(parameters.getDescriptor(), false) &&   // NOT method.getName()
    Constants.EPSG.equalsIgnoreCase(Citations.getCodeSpace(formatter.getNameAuthority()));
formatter.newLine();
formatter.indent(+1);
for (final GeneralParameterValue param : parameters.values()) {
  if (!filter || WKTUtilities.isEPSG(param.getDescriptor(), true)) {
    WKTUtilities.append(param, formatter);
origin: apache/sis

/**
 * Appends a {@linkplain ParameterValue parameter} in a {@code PARAMETER[…]} element.
 * If the supplied parameter is actually a {@linkplain ParameterValueGroup parameter group},
 * all contained parameters will be flattened in a single list.
 *
 * @param  parameter  the parameter to append to the WKT, or {@code null} if none.
 * @param  formatter  the formatter where to append the parameter.
 */
public static void append(GeneralParameterValue parameter, final Formatter formatter) {
  if (parameter instanceof ParameterValueGroup) {
    boolean first = true;
    for (final GeneralParameterValue param : ((ParameterValueGroup) parameter).values()) {
      if (first) {
        formatter.newLine();
        first = false;
      }
      append(param, formatter);
    }
  }
  if (parameter instanceof ParameterValue<?>) {
    if (!(parameter instanceof FormattableObject)) {
      parameter = new DefaultParameterValue<>((ParameterValue<?>) parameter);
    }
    formatter.append((FormattableObject) parameter);
    formatter.newLine();
  }
}
origin: org.apache.sis.core/sis-referencing

protected String formatTo(final Formatter formatter) {
  final ParameterDescriptor<T> descriptor = getDescriptor();  // Gives to users a chance to override this property.
  WKTUtilities.appendName(descriptor, formatter, ElementKind.PARAMETER);
  final Convention convention = formatter.getConvention();
  final boolean isWKT1 = convention.majorVersion() == 1;
    } else {
      if (convention != Convention.INTERNAL) {
        unit = WKTUtilities.toFormattable(unit);
origin: org.apache.sis.core/sis-referencing

  @Override protected String formatTo(final Formatter formatter) {
    WKTUtilities.appendParamMT(values, formatter);
    return WKTKeywords.Param_MT;
  }
});
origin: apache/sis

/**
 * Appends a {@linkplain ParameterValueGroup group of parameters} in a {@code Param_MT[…]} element.
 *
 * @param  parameters  the parameter to append to the WKT, or {@code null} if none.
 * @param  formatter   the formatter where to append the parameter.
 */
public static void appendParamMT(final ParameterValueGroup parameters, final Formatter formatter) {
  if (parameters != null) {
    appendName(parameters.getDescriptor(), formatter, ElementKind.PARAMETER);
    append(parameters, formatter);
  }
}
origin: org.apache.sis.core/sis-referencing

WKTUtilities.appendName(this, formatter, ElementKind.forType(getClass()));
return null;
origin: org.apache.sis.core/sis-referencing

final String type = WKTUtilities.toType(CoordinateSystem.class, getInterface());
if (type == null) {
  formatter.setInvalidWKT(this, null);
org.apache.sis.internal.referencingWKTUtilities

Javadoc

Utility methods for referencing WKT formatting. This class provides a set of toFormattable(…) for various IdentifiedObject subtypes. It is important to not provide a generic toFormattable(IdentifiedObject)method, because the user may choose to implement more than one GeoAPI interface for the same object. We need to be specific in order to select the right "aspect" of the given object.

Most used methods

  • appendName
    Appends the name of the given object to the formatter.
  • appendParamMT
    Appends a ParameterValueGroup in a Param_MT[…] element.
  • suggestFractionDigits
    Suggests an amount of fraction digits to use for formatting numbers in each column of the given sequ
  • 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

  • Making http post requests using okhttp
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • putExtra (Intent)
  • getApplicationContext (Context)
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Github Copilot alternatives
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