Class: Georeference::GPX

Inherits:
Georeference
  • Object
show all
Defined in:
app/models/georeference/gpx.rb

Overview

A Georeference derived from a GPX JSON object.

Instance Method Summary collapse

Constructor Details

#initialize(request_params) ⇒ GPX

Returns a new instance of GPX.



5
6
7
8
# File 'app/models/georeference/gpx.rb', line 5

def initialize(request_params)
  super

end

Instance Method Details

#dwc_georeference_attributesObject



21
22
23
24
25
26
27
28
29
# File 'app/models/georeference/gpx.rb', line 21

def dwc_georeference_attributes
  h = {}
  super(h)
  h.merge!(
    georeferenceSources: 'GPX data stored in image.',
    georeferenceRemarks: 'Auto-generated by dropping a image with coodrinates into a TaxonWorks interface.')
    h[:georeferenceProtocol] ='Ex GPX data stored in image.' if h[:georeferenceProtocol].blank? 
  h
end

#make_geographic_item(geo_type, shape) ⇒ Object

coordinates is an Array of Stings of [longitude, latitude]

Parameters:

  • geo_type (Symbol)
  • shape (Ignored)


13
14
15
16
17
18
19
# File 'app/models/georeference/gpx.rb', line 13

def make_geographic_item(geo_type, shape)
  case geo_type
    when :line_string
    when :point
  end
  self.geographic_item = GeographicItem.new(point: Gis::FACTORY.point(coordinates[0], coordinates[1]))
end