spec/factory.rb in aixm-0.3.0 vs spec/factory.rb in aixm-0.3.1

- old
+ new

@@ -36,12 +36,14 @@ end def layer AIXM.layer( class: :C, + location_indicator: 'XXXX', vertical_limits: vertical_limits ).tap do |layer| + layer.activity = :aerodrome_traffic layer.timetable = AIXM::H24 layer.selective = true layer.remarks = 'airspace layer' end end @@ -75,29 +77,27 @@ # Airspaces def polygon_airspace AIXM.airspace( source: 'LF|GEN|0.0 FACTORY|0|0', - region: 'LF', id: 'PA', type: :danger_area, - name: 'POLYGON AIRSPACE', - short_name: 'POLYGON' + local_type: 'POLYGON', + name: 'POLYGON AIRSPACE' ).tap do |airspace| airspace.layers << layer airspace.geometry = polygon_geometry end end def circle_airspace AIXM.airspace( source: 'LF|GEN|0.0 FACTORY|0|0', - region: 'LF', id: 'CA', type: :danger_area, - name: 'CIRCLE AIRSPACE', - short_name: 'CIRCLE' + local_type: 'CIRCLE', + name: 'CIRCLE AIRSPACE' ).tap do |airspace| airspace.layers << layer airspace.geometry = circle_geometry end end @@ -105,11 +105,10 @@ # Navigational aids def designated_point AIXM.designated_point( source: 'LF|GEN|0.0 FACTORY|0|0', - region: 'LF', id: 'DDD', name: 'DESIGNATED POINT NAVAID', xy: AIXM.xy(lat: %q(47°51'33"N), long: %q(007°33'36"E)), z: AIXM.z(500, :qnh), type: :ICAO @@ -120,11 +119,10 @@ end def dme AIXM.dme( source: 'LF|GEN|0.0 FACTORY|0|0', - region: 'LF', organisation: organisation, id: 'MMM', name: 'DME NAVAID', xy: AIXM.xy(lat: %q(47°51'33"N), long: %q(007°33'36"E)), z: AIXM.z(500, :qnh), @@ -136,11 +134,10 @@ end def marker AIXM.marker( source: 'LF|GEN|0.0 FACTORY|0|0', - region: 'LF', organisation: organisation, id: '---', name: 'MARKER NAVAID', xy: AIXM.xy(lat: %q(47°51'33"N), long: %q(007°33'36"E)), z: AIXM.z(500, :qnh), @@ -152,11 +149,10 @@ end def ndb AIXM.ndb( source: 'LF|GEN|0.0 FACTORY|0|0', - region: 'LF', organisation: organisation, id: 'NNN', name: 'NDB NAVAID', xy: AIXM.xy(lat: %q(47°51'33"N), long: %q(007°33'36"E)), z: AIXM.z(500, :qnh), @@ -169,11 +165,10 @@ end def tacan AIXM.tacan( source: 'LF|GEN|0.0 FACTORY|0|0', - region: 'LF', organisation: organisation, id: 'TTT', name: 'TACAN NAVAID', xy: AIXM.xy(lat: %q(47°51'33"N), long: %q(007°33'36"E)), z: AIXM.z(500, :qnh), @@ -185,11 +180,10 @@ end def vor AIXM.vor( source: 'LF|GEN|0.0 FACTORY|0|0', - region: 'LF', organisation: organisation, id: 'VVV', name: 'VOR NAVAID', xy: AIXM.xy(lat: %q(47°51'33"N), long: %q(007°33'36"E)), z: AIXM.z(500, :qnh), @@ -203,11 +197,10 @@ end def vordme AIXM.vor( source: 'LF|GEN|0.0 FACTORY|0|0', - region: 'LF', organisation: organisation, id: 'VDD', name: 'VOR/DME NAVAID', xy: AIXM.xy(lat: %q(47°51'33"N), long: %q(007°33'36"E)), z: AIXM.z(500, :qnh), @@ -222,11 +215,10 @@ end def vortac AIXM.vor( source: 'LF|GEN|0.0 FACTORY|0|0', - region: 'LF', organisation: organisation, id: 'VTT', name: 'VORTAC NAVAID', xy: AIXM.xy(lat: %q(47°51'33"N), long: %q(007°33'36"E)), z: AIXM.z(500, :qnh), @@ -243,11 +235,10 @@ # Organisation def organisation AIXM.organisation( source: 'LF|GEN|0.0 FACTORY|0|0', - region: 'LF', name: 'FRANCE', type: 'S' ).tap do |organisation| organisation.id = 'LF' organisation.remarks = 'Oversea departments not included' @@ -257,11 +248,10 @@ # Unit def unit AIXM.unit( source: 'LF|GEN|0.0 FACTORY|0|0', - region: 'LF', organisation: organisation, name: 'PUJAUT TWR', type: :aerodrome_control_tower, class: :icao ).tap do |unit| @@ -297,13 +287,12 @@ # Airport def airport AIXM.airport( source: 'LF|GEN|0.0 FACTORY|0|0', - region: 'LF', organisation: organisation, - code: 'LFNT', + id: 'LFNT', name: 'Avignon-Pujaut', xy: AIXM.xy(lat: %q(43°59'46"N), long: %q(004°45'16"E)) ).tap do |airport| airport.gps = "LFPUJAUT" airport.z = AIXM.z(146, :qnh) @@ -357,9 +346,10 @@ # Document def document time = Time.parse('2018-01-01 12:00:00 +0100') AIXM.document( + region: 'LF', namespace: '00000000-0000-0000-0000-000000000000', created_at: time, effective_at: time ).tap do |document| document.features << organisation