| 1 | package WebService::SOS::Observations; | ||
| 2 | 1 | ▶ | use XML::Rabbit::Root 0.1.0; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | |||
| 4 | 1 | add_xpath_namespace 'ows' => 'http://www.opengis.net/ows/1.1'; | |
| 5 | 1 | add_xpath_namespace 'om' => 'http://www.opengis.net/om/1.0'; | |
| 6 | |||
| 7 | 1 | has_xpath_value description => './gml:description'; | |
| 8 | 1 | has_xpath_value name => './gml:name'; | |
| 9 | |||
| 10 | 1 | has_xpath_value lowerCorner => './om:member/om:Observation/gml:boundedBy/gml:Envelope/gml:lowerCorner'; | |
| 11 | 1 | has_xpath_value upperCorner => './om:member/om:Observation/gml:boundedBy/gml:Envelope/gml:upperCorner'; | |
| 12 | 1 | has_xpath_value beginTime => './om:member/om:Observation/om:samplingTime/gml:TimePeriod/gml:beginPosition'; | |
| 13 | 1 | has_xpath_value endTime => './om:member/om:Observation/om:samplingTime/gml:TimePeriod/gml:endPosition'; | |
| 14 | 1 | has_xpath_value procedure => './om:member/om:Observation/om:procedure/@xlink:href'; | |
| 15 | 1 | has_xpath_value_list observedProperties => './om:member/om:Observation/om:observedProperty/swe:CompositePhenomenon/swe:component/@xlink:href'; | |
| 16 | 1 | has_xpath_value featureOfInterest => './om:member/om:Observation/om:featureOfInterest/@xlink:href'; | |
| 17 | 1 | has_xpath_value elementCount => './om:member/om:Observation/om:result/swe:DataArray/swe:elementCount/swe:Count/swe:value'; | |
| 18 | 1 | has_xpath_value_list fieldList => './om:member/om:Observation/om:result/swe:DataArray/swe:elementType/swe:DataRecord/swe:field/@name'; | |
| 19 | 1 | has_xpath_value blockSeparator => './om:member/om:Observation/om:result/swe:DataArray/swe:encoding/swe:TextBlock/@blockSeparator'; | |
| 20 | 1 | has_xpath_value decimalSeparator => './om:member/om:Observation/om:result/swe:DataArray/swe:encoding/swe:TextBlock/@decimalSeparator'; | |
| 21 | 1 | has_xpath_value tokenSeparator => './om:member/om:Observation/om:result/swe:DataArray/swe:encoding/swe:TextBlock/@tokenSeparator'; | |
| 22 | 1 | has_xpath_value allValues => './om:member/om:Observation/om:result/swe:DataArray/swe:values'; | |
| 23 | |||
| 24 | 1 | has_xpath_object_list fields => './om:member/om:Observation/om:result/swe:DataArray/swe:elementType/swe:DataRecord/swe:field' => 'WebService::SOS::SWEField'; | |
| 25 | |||
| 26 | 1 | has 'exception' => ( | |
| 27 | is => 'ro', | ||
| 28 | isa => 'Bool', | ||
| 29 | default => 0, | ||
| 30 | ); | ||
| 31 | |||
| 32 | 1 | has 'values' => ( | |
| 33 | is => 'ro', | ||
| 34 | isa => 'ArrayRef', | ||
| 35 | lazy_build => 1, | ||
| 36 | ); | ||
| 37 | |||
| 38 | 0 | ▶ | sub _build_values { |
|
Subroutine
_build_values: not called CC=3 SCAR=24.8
| |||
| 39 | 0 | my $self = shift; | |
| 40 | 0 | my @valueBlocks = split $self->blockSeparator, $self->allValues; | |
| 41 | |||
| 42 | 0 | my @values; | |
| 43 | 0 | for my $valueBlock (@valueBlocks) { | |
| 44 | 0 | my @value = split $self->tokenSeparator, $valueBlock; | |
| 45 | 0 | my %fields; | |
| 46 | 0 | my $fieldnum = 0; | |
| 47 | 0 | for my $fieldval (@value) { | |
| 48 | 0 | my $fieldname = @{$self->fieldList}[$fieldnum]; | |
| 49 | 0 | $fields{$fieldname} = $fieldval; | |
| 50 | 0 | $fieldnum++; | |
| 51 | } | ||
| 52 | 0 | push @values, \%fields; | |
| 53 | } | ||
| 54 | 0 | return \@values; | |
| 55 | } | ||
| 56 | |||
| 57 | 1 | finalize_class(); | |