All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.backendless.persistence.SpatialReferenceSystemEnum Maven / Gradle / Ivy

The newest version!
package com.backendless.persistence;


public enum SpatialReferenceSystemEnum
{
  CARTESIAN(0, "Cartesian"),
//  PULKOVO_1995( 4200, "Pulkovo 1995"),
  WGS84( 4326, "WGS 84"),
//  WGS84_PSEUDO_MERCATOR(3857, "WGS 84 / Pseudo-Mercator"),
//  WGS84_WORLD_MERCATOR(3395, "WGS 84 / World Mercator"),
  ;

  /**
   * The default SRS that will be used for any spatial type (in case when you omit it during creation)
   */
  public static SpatialReferenceSystemEnum DEFAULT = SpatialReferenceSystemEnum.WGS84;

  private final int srsId;
  private final String name;

  SpatialReferenceSystemEnum( int srsId, String name )
  {
    this.srsId = srsId;
    this.name = name;
  }

  public static SpatialReferenceSystemEnum valueBySRSId( int srsId )
  {
    for( SpatialReferenceSystemEnum srs : SpatialReferenceSystemEnum.values() )
    {
      if( srs.getSRSId() == srsId )
        return srs;
    }

    throw new IllegalArgumentException( "SpatialReferenceSystem doesn't contain value with id " + srsId );
  }

  public int getSRSId()
  {
    return srsId;
  }

  public String getName()
  {
    return name;
  }

  @Override
  public String toString()
  {
    return this.getName() + "(" + this.getSRSId() + ")";
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy