10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/miami_dade_geo/geo_attribute_client.rb', line 10
def all_fields(table, field_name, value)
body = savon.
call(:get_all_fields_records_given_a_field_name_and_value,
message: {
'strFeatureClassOrTableName' => table,
'strFieldNameToSearchOn' => field_name,
'strValueOfFieldToSearchOn' => value
}).
body
resp = body[:get_all_fields_records_given_a_field_name_and_value_response]
rslt = resp[:get_all_fields_records_given_a_field_name_and_value_result]
polys = rslt[:diffgram][:document_element][:municipality_poly]
poly = if polys.is_a? Array
polys.first
elsif polys.is_a? Hash
polys
else
fail "Unexpected polys #{polys.class.name}, wanted Array or Hash"
end
end
|