Exemplo n.º 1
0
func (s SediAutocompleteResponse) ToAddressPackage() t.AddressPackage {
	result := t.AddressPackage{}
	rows := []t.AddressF{}
	for _, s_addr_f := range s {
		rows = append(rows, t.AddressF{
			ID:          s_addr_f.Id,
			Name:        s_addr_f.Name,
			City:        s_addr_f.City,
			Coordinates: t.Coordinates{Lat: s_addr_f.Geo.Lat, Lon: s_addr_f.Geo.Lon}})
	}
	result.Rows = &rows
	return result
}
Exemplo n.º 2
0
func (sgcr SediGeoCodingResult) toAddressPackage() t.AddressPackage {
	rows := []t.AddressF{}
	for _, address_res := range sgcr.Addresses {
		rows = append(rows, t.AddressF{
			ID:          address_res.ID,
			City:        address_res.CityName,
			Name:        address_res.StreetName,
			PostalCode:  address_res.PostalCode,
			HouseNumber: address_res.HouseNumber,
			Coordinates: t.Coordinates{Lat: address_res.GeoPoint.Lat, Lon: address_res.GeoPoint.Lon},
		})
	}
	result := t.AddressPackage{}
	result.Rows = &rows
	return result
}