Class: Proj4::ProjectionType
Class Method Summary collapse
-
.list ⇒ Object
Return list of all projection types we know about.
Instance Method Summary collapse
-
#descr ⇒ Object
Get description of this projection type as a multiline string.
-
#id ⇒ Object
Get ID of this projection type.
-
#inspect ⇒ Object
Returns a projection type as string in format ‘#<Proj4::PrimeMeridian id=“…”, name=“…”>’.
-
#name ⇒ Object
Gets name of this projection type.
Methods inherited from Def
#<=>, #==, get, #initialize, #to_s
Constructor Details
This class inherits a constructor from Proj4::Def
Class Method Details
.list ⇒ Object
Return list of all projection types we know about.
call-seq: list -> Array of Proj4::ProjectionType
407 408 409 410 411 412 413 414 |
# File 'ext/projrb.c', line 407
static VALUE projection_type_list(VALUE self){
struct PJ_LIST *pt;
VALUE list = rb_ary_new();
for (pt = pj_get_list_ref(); pt->id; pt++){
rb_ary_push(list, Data_Wrap_Struct(cProjectionType, 0, 0, pt));
}
return list;
}
|
Instance Method Details
#descr ⇒ Object
Get description of this projection type as a multiline string.
call-seq: descr -> String
430 431 432 433 434 |
# File 'ext/projrb.c', line 430
static VALUE projection_type_get_descr(VALUE self){
struct PJ_LIST *pt;
Data_Get_Struct(self,struct PJ_LIST,pt);
return rb_str_new2(*(pt->descr));
}
|
#id ⇒ Object
Get ID of this projection type.
call-seq: id -> String
420 421 422 423 424 |
# File 'ext/projrb.c', line 420
static VALUE projection_type_get_id(VALUE self){
struct PJ_LIST *pt;
Data_Get_Struct(self,struct PJ_LIST,pt);
return rb_str_new2(pt->id);
}
|
#inspect ⇒ Object
Returns a projection type as string in format ‘#<Proj4::PrimeMeridian id=“…”, name=“…”>’.
call-seq: inspect -> String
445 446 447 |
# File 'lib/proj4.rb', line 445 def inspect "#<Proj4::ProjectionType id=\"#{id}\", name=\"#{name}\">" end |
#name ⇒ Object
Gets name of this projection type.
call-seq: name -> String
453 454 455 |
# File 'lib/proj4.rb', line 453 def name descr.sub(/\n.*/m, '') end |