Tabnine Logo
Formatter.getEnclosingElement
Code IndexAdd Tabnine to your IDE (free)

How to use
getEnclosingElement
method
in
org.apache.sis.io.wkt.Formatter

Best Java code snippets using org.apache.sis.io.wkt.Formatter.getEnclosingElement (Showing top 16 results out of 315)

origin: apache/sis

/**
 * Returns {@code true} if the given formatter is in the process of formatting the base CRS of an
 * {@link AbstractDerivedCRS}. In such case, the coordinate system axes shall not be formatted.
 *
 * <p>This method should return {@code true} when {@code this} CRS is the value returned by
 * {@link GeneralDerivedCRS#getBaseCRS()} (typically {@link AbstractDerivedCRS#getBaseCRS()}).
 * Since the base CRS is the only CRS enclosed in derived CRS, we should have no ambiguity
 * (assuming that the user did not created some weird subclass).</p>
 *
 * <p>This method should be invoked for WKT 2 formatting only.</p>
 */
static boolean isBaseCRS(final Formatter formatter) {
  return formatter.getEnclosingElement(1) instanceof GeneralDerivedCRS;
}
origin: org.apache.sis.core/sis-referencing

/**
 * Returns {@code true} if the given formatter is in the process of formatting the base CRS of an
 * {@link AbstractDerivedCRS}. In such case, the coordinate system axes shall not be formatted.
 *
 * <p>This method should return {@code true} when {@code this} CRS is the value returned by
 * {@link GeneralDerivedCRS#getBaseCRS()} (typically {@link AbstractDerivedCRS#getBaseCRS()}).
 * Since the base CRS is the only CRS enclosed in derived CRS, we should have no ambiguity
 * (assuming that the user did not created some weird subclass).</p>
 *
 * <p>This method should be invoked for WKT 2 formatting only.</p>
 */
static boolean isBaseCRS(final Formatter formatter) {
  return formatter.getEnclosingElement(1) instanceof GeneralDerivedCRS;
}
origin: org.apache.sis.core/sis-referencing

/**
 * Returns {@code true} if the given formatter is in the process of formatting the prime meridian of a base CRS
 * of an {@code AbstractDerivedCRS}. In such case, base CRS coordinate system axes shall not be formatted, which
 * has the consequence of bringing the {@code UNIT[…]} element right below the {@code PRIMEM[…]} one. Example:
 *
 * {@preformat wkt
 *   ProjectedCRS[“NTF (Paris) / Lambert zone II”,
 *     BaseGeodCRS[“NTF (Paris)”,
 *       Datum[“Nouvelle Triangulation Francaise”,
 *         Ellipsoid[“NTF”, 6378249.2, 293.4660212936269]],
 *       PrimeMeridian[“Paris”, 2.5969213],
 *       AngleUnit[“grad”, 0.015707963267948967]],
 *     Conversion[“Lambert zone II”,
 *       etc...
 * }
 *
 * If we were not formatting a base CRS, we would have many lines between {@code PrimeMeridian[…]} and
 * {@code AngleUnit[…]} in the above example, which would make less obvious that the angle unit applies
 * also to the prime meridian. It does not bring any ambiguity from an ISO 19162 standard point of view,
 * but historically some other software products interpreted the {@code PRIMEM[…]} units wrongly, which
 * is why we try to find a compromise between keeping the WKT simple and avoiding an historical ambiguity.
 *
 * @see org.apache.sis.referencing.crs.AbstractCRS#isBaseCRS(Formatter)
 */
private static boolean isElementOfBaseCRS(final Formatter formatter) {
  return formatter.getEnclosingElement(2) instanceof GeneralDerivedCRS;
}
origin: apache/sis

/**
 * Returns {@code true} if the given formatter is in the process of formatting the prime meridian of a base CRS
 * of an {@code AbstractDerivedCRS}. In such case, base CRS coordinate system axes shall not be formatted, which
 * has the consequence of bringing the {@code UNIT[…]} element right below the {@code PRIMEM[…]} one. Example:
 *
 * {@preformat wkt
 *   ProjectedCRS[“NTF (Paris) / Lambert zone II”,
 *     BaseGeodCRS[“NTF (Paris)”,
 *       Datum[“Nouvelle Triangulation Francaise”,
 *         Ellipsoid[“NTF”, 6378249.2, 293.4660212936269]],
 *       PrimeMeridian[“Paris”, 2.5969213],
 *       AngleUnit[“grad”, 0.015707963267948967]],
 *     Conversion[“Lambert zone II”,
 *       etc...
 * }
 *
 * If we were not formatting a base CRS, we would have many lines between {@code PrimeMeridian[…]} and
 * {@code AngleUnit[…]} in the above example, which would make less obvious that the angle unit applies
 * also to the prime meridian. It does not bring any ambiguity from an ISO 19162 standard point of view,
 * but historically some other software products interpreted the {@code PRIMEM[…]} units wrongly, which
 * is why we try to find a compromise between keeping the WKT simple and avoiding an historical ambiguity.
 *
 * @see org.apache.sis.referencing.crs.AbstractCRS#isBaseCRS(Formatter)
 */
private static boolean isElementOfBaseCRS(final Formatter formatter) {
  return formatter.getEnclosingElement(2) instanceof GeneralDerivedCRS;
}
origin: org.apache.sis.core/sis-referencing

/**
 * Returns the enclosing coordinate system, or {@code null} if none. In ISO 19162 compliant WKT the coordinate
 * <strong>reference</strong> system should be the first parent ({@code formatter.getEnclosingElement(1)}) and
 * the coordinate system shall be obtained from that CRS (yes, this is convolved. This is because of historical
 * reasons, since compatibility with WKT 1 was a requirement of WKT 2).
 */
private static CoordinateSystem getEnclosingCS(final Formatter formatter) {
  final FormattableObject e = formatter.getEnclosingElement(1);
  if (e instanceof CoordinateReferenceSystem) {           // This is what we expect in standard WKT.
    return ((CoordinateReferenceSystem) e).getCoordinateSystem();
  }
  if (e instanceof CoordinateSystem) {                    // Not standard WKT, but conceptually the right thing.
    return (CoordinateSystem) e;
  }
  return null;
}
origin: apache/sis

/**
 * Returns the enclosing coordinate system, or {@code null} if none. In ISO 19162 compliant WKT the coordinate
 * <strong>reference</strong> system should be the first parent ({@code formatter.getEnclosingElement(1)}) and
 * the coordinate system shall be obtained from that CRS (yes, this is convolved. This is because of historical
 * reasons, since compatibility with WKT 1 was a requirement of WKT 2).
 */
private static CoordinateSystem getEnclosingCS(final Formatter formatter) {
  final FormattableObject e = formatter.getEnclosingElement(1);
  if (e instanceof CoordinateReferenceSystem) {           // This is what we expect in standard WKT.
    return ((CoordinateReferenceSystem) e).getCoordinateSystem();
  }
  if (e instanceof CoordinateSystem) {                    // Not standard WKT, but conceptually the right thing.
    return (CoordinateSystem) e;
  }
  return null;
}
origin: org.apache.sis.core/sis-metadata

final Integer code = Units.getEpsgCode(unit, getEnclosingElement(1) instanceof CoordinateSystemAxis);
if (code != null) {
  openElement(false, isWKT1 ? WKTKeywords.Authority : WKTKeywords.Id);
origin: apache/sis

final Integer code = Units.getEpsgCode(unit, getEnclosingElement(1) instanceof CoordinateSystemAxis);
if (code != null) {
  openElement(false, isWKT1 ? WKTKeywords.Authority : WKTKeywords.Id);
origin: org.apache.sis.core/sis-metadata

final FormattableObject enclosing = formatter.getEnclosingElement(1);
final boolean              isRoot = formatter.getEnclosingElement(2) == null;
if (isRoot || !(enclosing instanceof ParameterValue<?>)) {
  final String citation = org.apache.sis.internal.util.Citations.getIdentifier(authority, false);
origin: apache/sis

final FormattableObject enclosing = formatter.getEnclosingElement(1);
final boolean              isRoot = formatter.getEnclosingElement(2) == null;
if (isRoot || !(enclosing instanceof ParameterValue<?>)) {
  final String citation = org.apache.sis.internal.util.Citations.getIdentifier(authority, false);
origin: org.apache.sis.core/sis-referencing

final FormattableObject parent = formatter.getEnclosingElement(isWKT1 ? 1 : 2);
if (parent instanceof GeneralDerivedCRS) {
  final Conversion conversion = ((GeneralDerivedCRS) parent).getConversionFromBase();
origin: apache/sis

final FormattableObject parent = formatter.getEnclosingElement(isWKT1 ? 1 : 2);
if (parent instanceof GeneralDerivedCRS) {
  final Conversion conversion = ((GeneralDerivedCRS) parent).getConversionFromBase();
origin: org.apache.sis.core/sis-referencing

if (!(formatter.getEnclosingElement(1) instanceof GeodeticCRS)) {
  return formatter.shortOrLong(WKTKeywords.Datum, WKTKeywords.GeodeticDatum);
origin: apache/sis

if (!(formatter.getEnclosingElement(1) instanceof GeodeticCRS)) {
  return formatter.shortOrLong(WKTKeywords.Datum, WKTKeywords.GeodeticDatum);
origin: org.apache.sis.core/sis-referencing

final FormattableObject enclosing = formatter.getEnclosingElement(1);
final boolean isSubOperation = (enclosing instanceof PassThroughOperation);
final boolean isComponent    = (enclosing instanceof ConcatenatedOperation);
origin: apache/sis

final FormattableObject enclosing = formatter.getEnclosingElement(1);
final boolean isSubOperation = (enclosing instanceof PassThroughOperation);
final boolean isComponent    = (enclosing instanceof ConcatenatedOperation);
org.apache.sis.io.wktFormattergetEnclosingElement

Javadoc

Returns the enclosing WKT element, or null if element being formatted is the root. This method can be invoked by child elements having some aspects that depend on the enclosing element.

Popular methods of Formatter

  • append
    Appends rows of numbers. Each number is separated by a space, and each row is separated by a comma.
  • newLine
    Request a line separator before the next element to format. Invoking this method before any append(…
  • <init>
    Creates a new formatter instance with the specified convention, symbols and indentation.
  • appendAny
    Appends an object or an array of objects. This method performs the following choices: * If the given
  • getConvention
    Returns the convention to use for formatting the WKT. The default is Convention#WKT2.
  • getLocale
    Returns the locale to use for localizing InternationalString instances. This is not the locale for
  • indent
    Increases or decreases the indentation. A value of +1 increases the indentation by the amount of spa
  • setInvalidWKT
    Marks the current WKT representation of the given object as not strictly compliant with the WKT spec
  • toWKT
    Returns the WKT formatted by this object.
  • addContextualUnit
    Adds a unit to use for the next measurements of the quantity Q. The given unit will apply to all WKT
  • appendComplement
    Appends the optional complementary attributes common to many IdentifiedObject subtypes. Those attrib
  • appendElement
    Tries to append an object of the KEYWORD[something] form. The given value is typically, but not nece
  • appendComplement,
  • appendElement,
  • appendExact,
  • appendForSubtypes,
  • appendOnNewLine,
  • appendPreset,
  • appendSeparator,
  • appendTemporalExtent,
  • appendValue

Popular in Java

  • Start an intent from android
  • notifyDataSetChanged (ArrayAdapter)
  • getSystemService (Context)
  • findViewById (Activity)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • Socket (java.net)
    Provides a client-side TCP socket.
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Top 17 Free Sublime Text Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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