Method: Proj::PjObject#to_proj_string

Defined in:
lib/proj/pj_object.rb

#to_proj_string(proj_version = :PJ_PROJ_5, use_approx_tmerc: false, multiline: false, indentation_width: 2, max_line_length: 80) ⇒ String

Returns the proj representation string for this object

Parameters:

  • proj_version (PJ_PROJ_STRING_TYPE) (defaults to: :PJ_PROJ_5)

    The proj version. Defaults to :PJ_PROJ_5

  • use_approx_tmerc (Boolean) (defaults to: false)

    True adds the approx flag to proj=tmerc or +proj=utm. Defaults to false

  • multiline (Boolean) (defaults to: false)

    Specifies if output span multiple lines. Defaults to false.

  • indentation_width (Integer) (defaults to: 2)

    Specifies the indentation level. Defaults to 2.

  • max_line_length (Integer) (defaults to: 80)

    Specifies the max line length level. Defaults to 80.

Returns:

  • (String)

See Also:



587
588
589
590
591
592
593
594
595
596
597
# File 'lib/proj/pj_object.rb', line 587

def to_proj_string(proj_version=:PJ_PROJ_5, use_approx_tmerc: false, multiline: false,
                                            indentation_width: 2, max_line_length: 80)

  options = {"USE_APPROX_TMERC": use_approx_tmerc ? "YES" : "NO",
             "MULTILINE": multiline ? "YES" : "NO",
             "INDENTATION_WIDTH": indentation_width,
             "MAX_LINE_LENGTH": max_line_length}

  options_ptr = create_options_pointer(options)
  Api.proj_as_proj_string(self.context, self, proj_version, options_ptr).force_encoding('UTF-8')
end